Visual Basic Flowcharts - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Visual Basic Flowcharts

Description:

Lets translate our Television-watching steps into pseudo-code. Begin task: Watching Television. ... Develop a pseudocode and flowchart for the following. Pick one! – PowerPoint PPT presentation

Number of Views:144
Avg rating:3.0/5.0
Slides: 17
Provided by: GMO105
Category:

less

Transcript and Presenter's Notes

Title: Visual Basic Flowcharts


1
Visual BasicFlowcharts
  • October 10, 2007

2
  • Turn in your vocabulary words
  • before you leave!

3
Algorithms
  • Is a finite sequence of effective statements
    that, when applied to the problem, will solve it!
  • An effective statement is a clear, unambiguous
    instruction that can be carried out.
  • Each algorithm you develop should have a specific
    beginning at the completion of one step, have
    the next step uniquely determined and have an
    ending that is reached in a reasonable amount of
    time.

4
Example Rise-and-shine algorithm
  • Problem
  • A student getting out of bed and going to school.

5
What is the algorithm?
  1. Get out of bed.
  2. Take off pajamas.
  3. Take a shower.
  4. Get dressed.
  5. Eat breakfast.
  6. Carpool to school/Take a bus.

6
Another one Watching Television
  1. Sit down on the sofa.
  2. Pick up the remote control.
  3. Point the remote control at the television.
  4. Press the Power button on the remote control.
  5. Wait a few seconds for the television to warm up.
  6. Do you like the program? If so, go to step 9.
  7. You do not like the program press the Next
    Channel button on the remote control.
  8. Got to step 6.
  9. Put the remote control on the coffee table.
  10. Relax.

7
Pseudocode
  • Step-by-step set of instructions that are very
    similar to computer programming instructions.
  • Written in every day English.
  • Helps programmers develop algorithms.
  • User friendly.
  • They are the steps on how to solve the problem.
  • They can be converted in computer code.

8
Lets translate our Television-watching steps into
pseudo-code.
  • Begin task Watching Television.
  • Sit down on the sofa.
  • Pick up the remote control.
  • Point the remote control at the television.
  • Press the Power button on the remote control.
  • Wait a few seconds.
  • Do you like the program?
  • a. Yes. Go to step 9.
  • b. No. Go to step 7.
  • Press the Next Channel button on the remote
    control.
  • Go to step 5.
  • Put the remote control on the coffee table.
  • Relax.
  • End task Watching Television.

9
Flowcharts!
  • Is a graphical representation of an algorithm or
    of a portion of an algorithm.
  • Are drawn using certain special-purpose symbols
    such as rectangles, diamonds, ovals, and small
    circles.
  • These symbols are connected by arrows called
    flowlines.
  • Are useful for developing and representing
    algorithms.
  • Clearly show how control structures operate.

10
Lets look at the symbols!
E X A M P L E
Action 1
Action 2
Rectangle
  • Also called an Action symbol.
  • Indicates any type of action. Examples a
    calculation or an input/output operation.

Action 3
11
Flowline Symbol
The lines connect other symbols, and the
arrowheads are mandatory only for right-to-left
and bottom-to-top flow.
12
Oval Symbol
Represents the beginning, the end, or a point of
interruption or delay in a program.
13
Connector Symbol
Represents any entry from, or exit to, another
part of the flowchart. Also serves as an
off-page connector.
14
Decision Symbol
Represents a decision that determines which of a
number of alternative paths is to be followed.
15
Lets turn our Pseudocode for watching television
into a flowchart!
Start
7 Press next channel
4 Press Power
8 Go to 5
1 Sit down on Sofa
5 Wait
9 Put remote down
2 Pick up Remote
10 Relax
N
Y
6 Do you like the program?
3 Point Remote
Stop
Go to Step 9
Go to step 7
16
Homework
  • Develop a pseudocode and flowchart for the
    following. Pick one! Your choice.
  • On a sheet of paper, draw a square of a specific
    size.
  • Get a drink of water.
  • Make a phone call.
Write a Comment
User Comments (0)
About PowerShow.com