3Easy
0/1

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

Data types Questions

Practise AQA GCSE Computer Science Data types with exam-style questions for GCSE Computer Science. 50 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Data types Questions

  1. GCSE
  2. /Computer Science
  3. /Data types