May/June 2026 Paper 21

2026 · 9 questions · 28 parts · 75 marks

0/75 marks
0Correct0Partial0Wrong28Unattempted
Filters0 active

Questions

Select a part to jump to its question

Finish set
9(a)Two Dimensional ArraysEasy2 marks
A hotel has three floors numbered 0 to 2 (floor 0 is the ground floor). There are 15 rooms on each floor. The hotel gets many enquiries from customers to check if a room is available that day. The availability data for that day is stored in a 2D array Version1
  • The first index is the floor number.
  • The second index is the room number.
  • On each of the three floors, the room numbers are 1 to 15.
Each cell of the array stores either:
  • 'A' – the room is available
  • 'B' – the room is already booked.
Write the declaration statement for the 2D array Version1
9(b)Two Dimensional ArraysHard6 marks
An enquiry program will:
  • input a floor number
  • output all room numbers that are available on that floor
  • output the number of rooms that are available.
The output must be in the format shown in the two examples. A wheelchair user makes an enquiry. She requires a room on the ground floor only. Example program outputs:
text
Floor number: 00 room(s) available
There are no available rooms on the ground floor.
text
Floor number: 07112 room(s) available
Shows two rooms available on the ground floor: rooms 7 and 11. Write pseudocode for this enquiry program.

Answer

0 words
9(c)(i)Records User Defined Data TypesMedium3 marks
Customers are becoming more selective with their enquiries when searching for an available room. A new program design is required. It will create a record to define the data for a room. Each room:
  • may have a sea view
  • is classified as: single room ('S'), double room ('D') or family room ('F')
  • is either standard ('ST') or deluxe ('DL').
Complete the pseudocode.
text
TYPE RoomData   …ENDTYPE
Declare RoomType, View and Grade
0 words
Closing keyword
9(c)(ii)Two Dimensional ArraysHard7 marks
The room data is stored in a 2D array Version2 of type RoomData The new enquiry program uses this new data design and will:
  • input the three customer requirements
  • output the floor number(s) and room number(s) for all matching available rooms.
Example program output:
text
Room type - S/D/F ?    FView - True/False ?    FalseRoom grade - ST/DL ?   DLMatching floor number and room number:0    40    5
The customer asks for a deluxe family room; no need for a sea view. The new enquiry program has found two matching rooms on the ground floor. Write pseudocode for the new enquiry program.

Answer

0 words