0% found this document useful (0 votes)
22 views

Drama Solution

Scenario Question- Drama

Uploaded by

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

Drama Solution

Scenario Question- Drama

Uploaded by

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

#Initializes SeatsBookked count to zero

SeatsBooked <- 0
#Calculating the number of setas already booked
FOR RowIndex<- 1 TO 10
FOR SeatIndex<- 1 TO 20
IF Evening[RowIndex,SeatIndex] = TRUE THEN
SeatsBooked <- SeatsBooked +1
ENDIF
NEXT SeatIndex
NEXT RowIndex
FreeSeats <- 200 -SeatsBooked # Calculate the number of free seats
OUTPUT "Enter the number of seats to book(Maximum 4):"
INPUT SeatsToBook

IF SeatsToBook>=1 AND SeatsToBook<=4 THEN


IF SeatsToBook>=FreeSeats THEN
SeatCount<-0
RowIndex<-1
WHILE RowIndex<=10 AND SeatCount<=SeatToBook
SeatIndex<- 1
WHILE SeatIndex<=20 AND SeatCount<=SeatsToBook
IF Evening[RowIndex,SeatIndex]= FALSE THEN
Evening[RowIndex,SeatIndex]<- TRUE
SeatCount<-SeatCount+1
ENDIF
SeatIndex<- SeatIndex +1
ENDWHILE
RowIndex<-RowIndex+1
ENDWHILE
ELSE
IF FreeSeats = 0 THEN
OUTPUT "Housefull"
ELSE
OUTPUT "Only ",FreeSeats," seats left"
ENDIF
ELSE
OUTPUT "Invalid number of seats requested"
ENDIF

You might also like