Preview

C++ Flowchart

Satisfactory Essays
Open Document
Open Document
1443 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
C++ Flowchart
Programming

Flowcharts
Flowcharts
A flowchart visually represents and organizes the steps used to write the program—it is a diagram of the “flow” of the process. When programmers write code, they need to give the robot instructions that are both sequential and specific. Flowcharts enable programmers to work these steps out before needing to translate their behaviors into code.

Reading flowcharts
Move from step to step in the chart by following the lines between them. Perform any action listed when you reach a Statement Block (rectangle), and then choose from several different paths to follow when you reach a Decision Block (diamond).

Parts of a Flow Chart Start of program — Marks the beginning of the program, begin here. Follow the line to get to the next block.

Start

Take one step forward

Statement block — A statement to execute, or a behavior to perform.

Decision block — A decision point in your program. Gone 50 steps? No
Ask a simple question, and do different things depending on the answer.

Yes/No (also True/False, etc.) — Answers to the question posed in the decision block. Follow the line labeled with the appropriate answer.

Yes End End of program — Marks the end of the program.
If you reach this point, the program is done!

Exercises
1. In the flowchart above, what will be the first action you take? _________________________________________________________ 2. If you haven’t gone 50 steps yet, what will you do next? ____________________________________________________________ 3. If you’ve gone 50 steps, what do you do? ______________________________________________________________________ 4. Describe the eventual result of your actions if you follow the flowchart above from start to finish. ________________________________
_____________________________________________________________________________________________________

NAME

DATE

6.5

©2005 Robomatter Inc. RE 2.5_RW 1.1

Programming

Flowcharts
Writing

You May Also Find These Documents Helpful