8.2 Arrays Model Answers
8.2 Arrays Model Answers
i) Many correct answers, they must be meaningful. This is an example only; [1 mark]
StudentNames[1:30]
ii) Many correct answers, they must be meaningful. This is an example only.
StudentMarksTest1[1:30]
StudentMarksTest2[1:30]
StudentMarksTest3[1:30] (1 mark)
StudentTotalScore[1:30] (1 mark)
[Total: 3 marks]
[Total: 3 marks]
Example answers
Count ← 0
REPEAT
PRINT "Student: ", Count, " Mark: ", Score[Count], " Grade:
",Grade[Count]
Count ← Count + 1
UNTIL Count = 30
Count ← 0
WHILE Count < 30 DO
PRINT "Student: ", Count, " Mark: ", Score[Count], " Grade:
",Grade[Count]
Count ← Count + 1
ENDWHILE
FOR Count ← 0 TO 29
PRINT "Student: ", Count, " Mark: ", Score[Count], " Grade: ",
Grade[Count]
NEXT
3
Note: reading and the output MUST be within the same loop.
For example:
Count ← 0
WHILE Count < 50 DO
OUTPUT Name[Count]
Count ← Count + 1
ENDWHILE
[Total: 3 marks]
Read the whole answer, award a mark from both of the following tables and add up the total.
The techniques and the data structures required are listed below. The requirements may be met
using a suitable built-in function from the programming language used (e.g. Python, VB.NET or
Java).
Techniques required:
CONSTANT Distinction = 70
CONSTANT Merit = 55
CONSTANT Pass = 40
[Total: 15 marks]