EXT – CWK Task 3

A system used for booking seats in a theatre will check for a continuous block of seats on any row so that a group of people can sit together.
Here is an example of a small block of seats with 5 rows, labelled A to E, with 10 seats per row numbered 1–10.
E1 E2 E3 E4 E5 E6 E7 E8 E9 E10
D1 D2 D3 D4 D5 D6 D7 D8 D9 D10
C1 C2 C3 C4 C5 C6 C7 C8 C9 C10
B1 B2 B3 B4 B5 B6 B7 B8 B9 B10
A1 A2 A3 A4 A5 A6 A7 A8 A9 A10
Design, code, test and evaluate a program to search through the available seats to locate a block of seats in a specified row for groups of up to 6 people.
The input will be:
• the number of people in the group up to a maximum of 6
• the desired row, A–E.

The output should:
• confirm if there is a block of seats available in the chosen row
• the corresponding seat numbers in the format:
• availability, number of seats ‘seat number – seat number’
• (eg “Seats available for 5 people B2–B6”).
• or should output a message that indicates:
• that there is no block of that size available
• the maximum block size available.

Scroll to Top