0% found this document useful (0 votes)
15 views2 pages

Seat Booking Pseudocode

Uploaded by

Sidney Kemp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Seat Booking Pseudocode

Uploaded by

Sidney Kemp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Seat Booking Pseudocode

DECLARE
DECLARE

MaxSeats  200
SeatCounter  0
Rows  10
Seats  20

FOR row  1 TO Rows


FOR col  1 TO Seats
IF Evening [row, col] = True THEN
SeatCounter  SeatCounter + 1
ENDIF
NEXT col
NEXT row

ContinueBooking  “Y”

WHILE ContinueBooking = “Y”


INPUT “Enter the number of seats required – max of 4” SeatsBooked
WHILE SeatsBooked < 1 OR SEATSBOOKED > 4 DO
OUTPUT “Error Message – max seats can only be 4”
INPUT SeatsBooked
ENDWHILE
IF SeatCounter >= MaxSeats THEN
OUTPUT “House Full – no seats available”
ELSE
IF SeatCount + SeatsBooked > MaxSeats THEN
OUTPUT “There are only” (MaxSeats + SeatsBooked) – MaxSeats “seats
available”
ELSE
FOR counter  1 TO SeatsBooked
Evening[(SeatCounter + counter) DIV Seats), (SeatCounter +
counter) MOD Seats)]  TRUE
OUTPUT “Seat booked = Row”, [(SeatCounter + counter) DIV
Seats),”Seat Number =”, ), (SeatCounter + counter) MOD Seats)
NEXT counter
ENDIF
ENDIF
INPUT “Do you want to continue booking, enter Y or N” ContinueBooking
ENDWHILE

You might also like