Refer to the following algorithm written in pseudocode which uses a RECORD data structure to store information about students:
RECORD Student
name : String
studentID : String
yearGroup : Integer
enrolled : Boolean
ENDRECORD
student1 ← Student('Alice', 'STU108', 10, True)
student2 ← Student('Bob', 'STU204', 11, False)
student3 ← Student('Charlie', 'STU092', 9, True)
studentRoster ← [student1, student2, student3]
highestYear ← 0
index ← 0
FOR i ← 0 TO 2
IF studentRoster[i].yearGroup > highestYear THEN
highestYear ← studentRoster[i].yearGroup
index ← i
ENDIF
ENDFOR
OUTPUT studentRoster[index].name, ' is in the highest year group'
How many different values can the field enrolled have?
2
4
128
256
50 exam-style questions on AQA GCSE Computer Science Data types. Each one has a worked solution and a mark scheme showing where the marks go.