AQA GCSE · Question 09.1 · Programming
Figure 8 shows an algorithm that uses a RECORD data structure for storing information about a film.
Figure 8
RECORD Film
title : String
certificate : String
year : Integer
beingShown : Boolean
ENDRECORD
hulk ← Film('Hulk', '12A', 2005, False)
ironMan ← Film('Iron Man', '12A', 2008, False)
antMan ← Film('Ant-Man', '12A', 2015, False)
filmCollection ← [antMan, hulk, ironMan]
year ← 0
position ← 0
FOR i ← 0 TO L1
IF filmCollection[i].year > year THEN
year ← filmCollection[i].year
position ← i
ENDIF
ENDFOR
OUTPUT filmCollection[position].title, ' is the newest film'
How many different values can the field beingShown have?
Answer options:
2
3
128
256
31 questions · hints · full answers · grading