Pseudocode VS Flowchart
Pseudocode VS Flowchart
Start
Print answer
Get 2 numbers
End
Add them
What are those funny symbols?
START/END
INPUT/OUTPUT
PROCESS
DECISION
What are those funny symbols?
START/END
Used at the beginning
and end of each
flowchart.
What are those funny symbols?
INPUT/OUTPUT
Shows when
information/data comes
into a program or is
printed out.
What are those funny symbols?
What are those funny symbols?
PROCESS
Used to show
calculations, storing of
data in variables, and
other “processes” that
take place within a
program.
What are those funny symbols?
What are those funny symbols?
DECISION
Used to show that the
program must decide Y
whether something X>7?
(usually a comparison
N
between numbers) is
true or false. YES and
NO (or T/F) branches
are usually shown.
Another Sample:
Calculating Age
Pseudocode:
Start
Get year DOB
Calculate age = (sysdate-DOB)
Print age
If age > 50 print OLD
End
Another Sample:
Start
Calculating Age
Get yr
Calc age
Flowchart
Start Print age
K will be printed. The answer to the question “Is X greater than 5?”
is NO, since X is equal to (not greater than) 5.
Self-Check
Choose the correct
flowchart symbol for each
of these statements.
AGE>65?
Calc. Tax
START
Print NAME
Self-Check
Choose the correct
flowchart symbol for each
of these statements.
AGE>65?
Calc. Tax
START
Print NAME
Challenge
Try to write pseudocode and create a flowchart for a
program that calculates the average of three grades
and prints the average.
The word GOOD should be printed only if the average
is more than 80.
Challenge
Possible pseudocode
Start
Get three grades
Average them (add all of them / number of grads taken)
Print Average
Average>80?
If Yes, print GOOD
End
START
END
Challenge
Try to write pseudocode and create a flowchart for a
program that calculates the average of three grades
and prints the average.
The word GOOD should be printed only if the average
is more than 80.
Challenge
Possible pseudocode
Start
Get three grades
Average them
Print Average
Average>80?
If Yes, print GOOD
End
START
END
Algorithm for Computing Average Miles per
Gallon
Write a program to do the task: Print a list of the numbers
from 4 to 9, next to each number, print the square of the
number.