visual basic flowcharts october 10, 2007. turn in your vocabulary words before you leave!

16
Visual Basic Flowcharts October 10, 2007

Upload: mervin-thomas

Post on 17-Jan-2018

216 views

Category:

Documents


0 download

DESCRIPTION

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.

TRANSCRIPT

Page 1: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

Visual BasicFlowcharts

October 10, 2007

Page 2: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

Turn in your vocabulary words before you leave!

Page 3: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

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.

Page 4: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

Example: “Rise-and-shine algorithm”

Problem:A student getting out of bed and going to

school.

Page 5: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

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.

Page 6: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

Another one: Watching Television1. 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.

Page 7: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

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.

Page 8: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

Lets translate our Television-watching steps into pseudo-code.

Begin task: 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.6. Do you like the program?

a. Yes. Go to step 9.b. No. Go to step 7.

7. Press the Next Channel button on the remote control.8. Go to step 5.9. Put the remote control on the coffee table.10. Relax. End task: Watching Television.

Page 9: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

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.

Page 10: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

Lets look at the symbols!

Rectangle

•Also called an Action symbol.

•Indicates any type of action. Examples: a calculation or an input/output operation.

Action 1

Action 2

Action 3

E

X

A

M

P

L

E

Page 11: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

Flowline Symbol:

The lines connect other symbols, and the arrowheads are mandatory only for right-to-left and bottom-to-top flow.

Page 12: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

Oval Symbol:

Represents the beginning, the end, or a point of interruption or delay in a program.

Page 13: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

Connector Symbol:

Represents any entry from, or exit to, another part of the flowchart. Also serves as an off-page connector.

Page 14: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

Decision Symbol:

Represents a decision that determines which of a number of alternative paths is to be followed.

Page 15: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

Let’s turn our Pseudocode for watching television into a flowchart!

Start

1 Sit down on Sofa

2 Pick up Remote

3 Point Remote

4 Press Power

5 Wait

Y N

Go to Step 9 Go to step 7

Stop

7 Press next channel

8 Go to 5

9 Put remote down

10 Relax

6 Do you like the program?

Page 16: Visual Basic Flowcharts October 10, 2007. Turn in your vocabulary words before you leave!

Homework:

Develop a pseudocode and flowchart for the following. Pick one! Your choice.

1. On a sheet of paper, draw a square of a specific size.

2. Get a drink of water.3. Make a phone call.