Professional Documents
Culture Documents
Writing An Algorithm and Drawing Its Flowchart
Writing An Algorithm and Drawing Its Flowchart
Write an algorithm and draw the flowchart to determine a student’s final grade and
indicate whether it is passing or failing. The final grade is calculated as the average of
four marks
PSEUDOCODE ALGORITHM
• Read 4 marks Step 1. Start
• Calculate their average by adding then Step 2. Read 4 marks (m1, m2, m3, m4)
dividing by 4 Step 3. Calculate average = (m1+m2+m3+m4)/4
• If average is below 70 Step 4. If average is below 70
Print “FAILED” Print “FAILED”
else else
Print “PASSED” Print “PASSED”
Step 5. Stop
FLOWCHART
Start
Average = (m1+m2+m3+m4)/4
N
If average<70 Print “PASSED” 1
Y 1