Past-paper question · 2023 October-November · Paper 21 · Q10

Question 10 2023 · October-November · Paper 21 · 15 marks

Original past-paper question for 10
Original past-paper question for 10
Original past-paper question for 10
Original past-paper question for 10
Reveal official mark-scheme answer Official mark-scheme answer for 10

Official answer for Question 10

✓
AO2 (maximum 9 marks)

Question 15

✓
•
✓
AO3 (maximum 6 marks)
✓
Data Structures required names shown underlined must be used as given in the scenario
✓
2D Array or list Evening[1:10, 1:20] / Evening[0:9, 0:19]
✓
Variables Counter, SeatCounter, NumSeats, Row, Column
✓
Requirements (techniques)
✓
R1 Find number of seats available for each performance and output (searching, nested iteration, output)
✓
R2 Inputs and validates number of seats (input, iteration, and selection)
✓
R3 Checking if seats available (selection, assignment, output with appropriate messages)
✓
Example 15-mark answer in pseudocode
✓
// meaningful identifier names and appropriate data structures to store the data required
✓
DECLARE Counter, SeatCounter, NumSeats, Row, Column : INTEGER
✓
CONSTANT HouseFull = 200
✓
CONSTANT MaxRow = 10
✓
CONSTANT MaxColumn = 20
✓
SeatCounter1 0 // initialise seat counter for performance 1
✓
Cambridge IGCSE – Mark Scheme
✓
0478/21
✓
October/November 2023
✓
PUBLISHED
✓
Question
✓
Answer
✓
Marks
✓
FOR Row 1 TO 10

Mark scheme 0478_w23_ms_21.pdf →

Show text version of question

Question 10

Drama students put on a performance of a play for one evening. Seats in a small theatre can be booked for this performance.

The theatre has 10 rows of 20 seats. The status of the seat bookings for the evening is held in the two-dimensional (2D) Boolean array Evening[]

Each element contains FALSE if the seat is available and TRUE if the seat is booked.

Up to and including four seats can be booked at one time. Seats are allocated in order from those available. A row or seat number cannot be requested.

The array Evening[] has already been set up and some data stored.

Write a program that meets the following requirements:

  • counts and outputs the number of seats already booked for the evening
  • allows the user to input the number of seats required
  • validates the input
  • checks if enough seats are available:
  • if they are available
  • ○ changes the status of the seats ○ outputs the row number and seat number for each seat booked

  • if they are not available:

○ outputs a message giving the number of seats left or ‘House full’ if the theatre is fully booked.

You must use pseudocode or program code and add comments to explain how your code works. You do not need to declare any arrays or variables; you may assume that this has already been done. You do not need to initialise the data in the array Evening[] All inputs and outputs must contain suitable messages.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Question 13

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

Question 14

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..................................................................................................................................................

[15]

Question 15

Question 16

reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cambridgeinternational.org after the live examination series.

Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.

Topic relevance

Why this question appears here

98% assigned-topic match · Programming › Arrays

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 0478_w23_qp_21.pdf

Keep practising this topic