Question 9
AQA Computer Science June 2023 Paper 1C (8525/1C)GCSE4 marks
On the specification
- 9.1
- 3.2 Programming
- 9.2
- 3.2 Programming
- 9.3
- 3.2 Programming
- 9.4
- 3.2 Programming
Question text
9 box Figure 8 shows an algorithm, written using pseudo-code, that uses a RECORD data structure for storing information about a film. Each record stores four pieces of information about a film: • film title • certificate (eg 12A, PG) • year the film was made • if the film is currently being shown at a cinema. There are records for three films and these films are stored alphabetically in an array called filmCollection. The pseudo-code outputs the title of the newest of the three films. • Part of the algorithm has been replaced by the label . 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 IF filmCollection[i].year > year THEN year filmCollection[i].year position i ENDIF ENDFOR OUTPUT filmCollection[position].title, ' is the newest film' 9.1 How many different values can the field beingShown have? box Shade one lozenge. [1 mark] A 2 B 3 C 128 D 256 9.2 Which assignment statement changes the year the film Hulk was made to 2003? Shade one lozenge. [1 mark] A hulk.year 2003 B filmCollection[0].year 2003 C Film(year) 2003 D hulk(year) 2003 9.3 What should the label in Figure 8 be replaced by? Shade one lozenge. [1 mark] A 3 B LEN(filmCollection) C LEN(filmCollection) – 1 D Position 9.4 Write a pseudo-code statement that updates the antMan record to show that the film is currently being shown at the cinema. [1 mark]