MTH 280 · Introduction to Computer programming
Our notes
2 min readFlowchart symbols
| Symbol | Shape | Use |
|---|---|---|
| Terminal | oval (rounded rectangle) | Start and Stop |
| Input/Output | parallelogram | Read, Print |
| Process | rectangle | calculations, assignments |
| Decision | diamond | a yes/no question, two exits |
| Flow line | arrow | order of steps |
| Connector | small circle | joins parts of a chart (same page) |
| Off-page connector | pentagon (home plate) | continues on another page |
| Predefined process | rectangle with double side lines | a subroutine |
Rules for flowcharts
- One Start and one Stop.
- Flow goes top to bottom, left to right.
- A decision box has exactly two exits (Yes and No) and they must be labelled.
- Lines should not cross; use connectors if needed.
Flowchart in words: largest of three numbers
Start → Read A, B, C → Decision "A > B?"
- Yes → Decision "A > C?": Yes → Print A; No → Print C.
- No → Decision "B > C?": Yes → Print B; No → Print C.
All paths → Stop.
Loop in a flowchart
A loop is a decision whose exit arrow goes back up to an earlier box. Example: sum of numbers 1 to N: Start → Read N → SUM = 0, I = 1 → Decision "I ≤ N?" — Yes → SUM = SUM + I → I = I + 1 → back to the decision; No → Print SUM → Stop.
Pseudocode
Pseudocode is structured English halfway between an algorithm and real code. It has no fixed syntax but uses clear keywords: READ, PRINT, IF … THEN … ELSE … ENDIF, WHILE … ENDWHILE, FOR … TO … ENDFOR, and indentation.
Example: grade from a score.
READ score
IF score >= 70 THEN grade ← "A"
ELSE IF score >= 60 THEN grade ← "B"
ELSE IF score >= 50 THEN grade ← "C"
ELSE IF score >= 45 THEN grade ← "D"
ELSE IF score >= 40 THEN grade ← "E"
ELSE grade ← "F"
ENDIF
PRINT grade
(This is the usual 5-point scale used at UNIPORT and many Nigerian universities.)
Example: factorial of N.
READ N
fact ← 1
FOR i ← 1 TO N
fact ← fact × i
ENDFOR
PRINT fact
Trace for N = 5: 1, 2, 6, 24, 120.
Flowchart or pseudocode?
| Flowchart | Pseudocode |
|---|---|
| visual, easy to follow for small programs | quick to write and change |
| hard to draw and edit for big programs | closer to real code |
| good for showing branches | good for long or nested logic |
Exams usually ask: name and draw the symbols; draw a flowchart for a given problem (largest number, sum/average, even or odd, quadratic roots, grades); write pseudocode; trace a flowchart and give its output.
Common mistake: using a rectangle for input and output. Read and Print go in a parallelogram.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Best pick Programming Fundamentals/Flowcharts
(opens en.wikibooks.org in a new tab)
Wikibooks, Programming Fundamentals/Flowcharts, CC BY-SA 4.0 · licence
-
Programming Fundamentals/Pseudocode
(opens en.wikibooks.org in a new tab)
Wikibooks, Programming Fundamentals/Pseudocode, CC BY-SA 4.0 · licence
-
Flowchart
(opens en.wikipedia.org in a new tab)
Wikipedia, Flowchart, CC BY-SA 4.0 · licence
-
Pseudocode
(opens en.wikipedia.org in a new tab)
Wikipedia, Pseudocode, CC BY-SA 4.0 · licence
Watch
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.