Question 5
AQA Computer Science June 2024 Paper 1B (8525/1B)GCSE3 marks
On the specification
- 3.1 Fundamentals of algorithms3.2 Programming
Question text
5 Figure 4 shows an algorithm, represented using pseudo-code. box The algorithm calculates the total cost of hiring a hotel for a wedding. Figure 4 numberOfGuests USERINPUT numberOfRooms USERINPUT charge 25 IF numberOfGuests > 50 THEN totalCost numberOfGuests * 2 ELSE IF numberOfGuests ≥ 25 THEN totalCost numberOfGuests * 4 ELSE totalCost numberOfGuests * 5 ENDIF ENDIF totalCost totalCost + (numberOfRooms * 100) IF totalCost < 1400 THEN totalCost totalCost + charge ENDIF OUTPUT totalCost Complete the table below using the algorithm in Figure 4. [3 marks] Input value for Input value for Output numberOfGuests numberOfRooms 50 30 20 10 500 5