Overview of this chapter
- The components of flow chart
BEFORE YOU START:
- Always write in a Pencil
- Draw the shape neatly, which means:
- Use rulers for straight lines
- The connecting points of the line should be neat.
WARNING: FAILURE OF FULFILLING THESE REQUIREMENTS WOULD RESULT IN HEAVY DEDUCTION OF MARKS BY MS D. I’m not even kidding.
Use of Different boxes
|Circle||Start / End||1. Beginning and ending of program|
|2. Beginning and ending of subroutine|
|Trapezoid||Input / Output||Use to input or output|
|Rhombus||Conditional statement||1. IF / Switch case statement|
|2. Loops (Pre-condition and post-condition)|
|Square||Normal action||1. Calculations|
|2. CALL statements|
|2. RETURN statements|
|4. DECLARE statements|
|5. All the other normal statements|
Circles are for the starting and ending of a program or subroutine.
Every program or subroutine MUST have 1 “START” and at least 1 “END”.
Remember, After an “Return” statement in a subroutine, you would still need to furthermore point to the “End” statement, like this:
Trapezoids are used for Input and Output statements in the program.
Like pseudocode, just write “INPUT “. Note that it’s still necessary to declare the variables beforehand.
Rhombus does all the Conditional Statements in a flowchart, which includes:
- Conditional statements
- IF…(ELSE IF)…(ELSE)…ENDIF sentences
- Switch…Case sentences
- REPEAT…UNTIL loops
- WHILE…Do loops
- FOR…NEXT loops
All Rhombus Have and only have 2 arrows coming out, one is “YES” and the other is “NO”.
Which is the same as
DECLARE skill: STRING <- "" DECLARE all_skills: ARRAY OF STRING <- ["thinking skills", "language skills", "international mindness"] DO INPUT skill IF skill NOT IN all_skills THEN OUTPUT "Try again!" ENDIF WHILE skill NOT IN all_skills
Squares basically does everything else. They do
Function / Procedure call
Return statements (in a function)
And all other functions.