Question 9
AQA Computer Science June 2024 Paper 1B (8525/1B)GCSE7 marks
On the specification
- 9.1
- 3.2 Programming
- 9.2
- 3.2 Programming
- 9.3
- 3.1 Fundamentals of algorithms3.2 Programming
Question text
9.1 Which of the following best describes a data structure? box Shade one lozenge. [1 mark] A A number with a fractional part B A value such as a whole number C All of the data used and stored within a program D An organised collection of values 9.2 Figure 7 shows an incomplete algorithm, represented using pseudo-code. box The algorithm is used to store and manage books using records. The algorithm should do the following: • create a record definition called Book with the fields bookName, author and price • create a variable for each book using the record definition. Complete Figure 7 by filling in the gaps using the items in Table 2. • You may need to use some of the items in Table 2 more than once. • You will not need to use all the items in Table 2. [3 marks] Table 2 12 author B1 B2 Book bookName i Real OUTPUT String Boolean Figure 7 RECORD bookName : String : String price : ENDRECORD B1 Book("The Book Thief", "M Zusak", 9.99) B2 ("Divergent", "V Roth", 6.55) 9.3 Write an algorithm using pseudo-code to display the name of the most expensive box book. The algorithm should: • compare the price of B1 and the price of B2 • output the book name of the most expensive book • output Neither if the books are the same price. The algorithm should work for any values stored in B1 and B2 [3 marks]