COMPUTER SCIENCE 2210 · STRUCTURED PRACTICE
A student writes a program to validate student scores, calculate the total score, and identify distinctions (scores >= 80). The program contains three distinct bugs across its 14 lines:
01 HighScoreCount ← 0 02 FOR Student ← 1 TO 30 03 INPUT Score 04 PRNT "Processing student: ", Student 05 IF Score < 0 OR Score > 100 THEN 06 OUTPUT "Invalid score" 07 ELSE 08 ClassTotal ← ClassTotal + Score 09 IF Score > 80 THEN 10 HighScoreCount ← HighScoreCount + 1 11 ENDIF 12 ENDIF 13 NEXT Student 14 ClassAvg ← ClassTotal / 30
Identify the syntax error on line 04, explain why it prevents compilation, and provide the corrected pseudocode line.
Identify the uninitialised variable error affecting line 08, explain why it causes a logic or runtime error, and provide the correction.
Identify the boundary logic error on line 09, explain how it misclassifies student achievements, and provide the corrected line.
Explain the difference between using boundary test data versus abnormal test data when testing line 05.
Total: 11 marks

