LoopsExtendedIGCSE 0478
Count how many students passed
Combine a FOR loop and an IF statement to count how many of ten marks are 50 or more.
Ten students sit a test. A pass is a mark of 50 or more.
Write pseudocode that reads ten marks and outputs how many students passed.
Your program should
- Use a count-controlled loop for ten marks.
- Count only marks that are 50 or more.
- Output the pass count after the loop.
Sample input
40 50 61 22 90 49 50 88 12 73
Sample output
6
Starter
Pseudocode
// Read 10 marks. Count how many are 50 or more, then output that count.
DECLARE Index : INTEGER
DECLARE Mark : INTEGER
DECLARE PassCount : INTEGER