Send Close Add comments: (status displays here)
Got it!  This site "www.robinsnyder.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.  Note: This appears on each machine/browser from which this site is accessed.
Control flow charts
by RS  admin@robinsnyder.com : 1024 x 640


1. Control flow charts
A design of a solution can be concisely and precisely expressed as an algorithm (using the data structures and data flow diagrams from the problem definition step).

2. Control flow charts
Flow chartAn algorithm is a precise step by step method for solving a problem. A control flow chart (or flaw chart) is a pictorial form of an algorithm. Flowcharts are difficult to draw, process, and update. Flowcharts do not easily scale up to handle large programs.

Control flow charts went out of style in the 1970's, but people continue to use them. Avoid flow charts. Data flow (and other) charts are still very useful.

3. Flaw charts
Programming fallacyFallacy: Control flow charts are a good way to specify algorithms.
Avoid flaw chartsA flow chart has the following properties.

4. Useful charts
Logo: Unified modeling languageThere are many types of useful charts such as UML (Unified Modeling Language) charts.

Sequence diagram for submission Control flow charts are not useful. Instead, use pseudo-code.

[UML jobs, Alan Kay on bricklayers]

5. Armstrong R&D
In the 1980's, when starting to working at Armstrong R&D as a computer physicist, I ask some programmers, more than once, what a program did and showed him the code.

The programmer started to explain each line of code and what that statement did.

That was not useful. A flow chart is like that.

6. Control flow charts
There are many charts that are useful.

A data flow chart can be very useful.

A control flow chart for an algorithm intended to be coded in a programming language is not very useful.

7. Pseudo-code
Book: Structured programmingInstead of a flow chart, pseudo-code is used.

The pseudo-code idea developed in the 1970's as part of structured programming in order to express algorithms in a precise textual way such that reasoning about the correctness of algorithms and code could be facilitated.

8. Flow charts and pseudo-code
Pseudo-code is a written form of an algorithm (that is easily processed using computer text editors) and should be closely related to the final program form.


9. Pseudo-code for polygon area
Get units and number of points Set total area to 0.0 FOR EACH pair of adjacent points\ (x1,y1) and (x2,y2) DO IF the pair is the first pair THEN Set the base (x0,y0) to (x1, y1) ELSE Calculate triangle area of points\ (x0,y0) , (x1,y1) , (x2,y2) Add area to total area END IF END FOR Output total area of the polygon


 ▶ 
 + 
 - 
 1. Start with 6 nodes. 
 2. Process from 1 to 6. 
 3. Node 1. No triangle yet. 
 4. Node 2. No triangle yet. 
 5. Node 3. Triangle area of 1 2 3. 
 6. Node 4. Triangle area of 1 3 4. 
 7. Node 5. Triangle area of 1 4 5. 
 8. Node 6. Triangle area of 1 5 6. 

10. Musical analogy
C scaleProvide the pseudo-code to the student in the first course.

Clefs Students learn with examples of how to do things.

11. Course assignments
Example: Pseudo-code for determining the area of a polygon.

Node 5. Triangle area of 1 4 5.This is an end-of-course goal. Work back from goal to previous assignments (top-down, backward chaining) to get subgoals. Assignment sequences are designed (by the teacher) top-down. Assignments are done (by the student) bottom-up.

12. Programming course
An introductory programming course should emphasis both ideas and mechanics of programming, but not require a high level of intelligence as in requiring the design of solutions for problems. My opinion (since about 2000): The introductory programming course should be the same for all majors. After that course, the student can decide which direction to take, provided the registrar and departments can handle such changes.

13. End of page

by RS  admin@robinsnyder.com : 1024 x 640