Past-paper question · 2016 May-June · Paper 21 · Q12(a)

Question 12(a) 2016 · May-June · Paper 21 · 11 marks

Question 12

Part (a)

Question 12

8 12 FALSE 12 0

Question 11

Part (a)

When a booking enquiry is made, the number of customers is given.

Complete the pseudocode for the procedure TakeBooking:

PROCEDURE TakeBooking

DECLARE ……………………………………………………, ………………………………………………………… : INTEGER

DECLARE …………………………………………………………………………………………………………………… : BOOLEAN

INPUT NumberOfCustomers

// initialise search for a suitable table

Found ← FALSE

TableNumber = ………………………………………………………………………………………………………………………………

REPEAT // find a table with enough seats

TableNumber ← TableNumber + 1

IF TableSeats[………………………………………] …………………………………………………………………………

AND Booked[……………………………………] ……………………………………………………………………

THEN

Found ← TRUE

ENDIF

UNTIL …………………………………………………………… OR ……………………………………………………………………………

IF Found = FALSE

THEN // no tables left with enough seats

……………………………………………………………………………………………………………………………………………………

ELSE // make the booking

Booked[……………………………………] ………………………………………………………………………………………

GroupSize[……………………………………] ………………………………………………………………………………

OUTPUT "Table number booked: ", TableNumber

ENDIF

ENDPROCEDURE

[11]

Question 12

Reveal official mark-scheme answer

The answer for this question is in the official mark scheme: open the mark scheme.

Mark scheme 9691_s16_ms_21.pdf →

Topic relevance

Why this question appears here

82% assigned-topic match · Programming › Constructs

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 9691_s16_qp_21.pdf

Keep practising this topic