Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The seating map for a particular performance at a theater contains 70 rows of 10

ID: 3571192 • Letter: T

Question

The seating map for a particular performance at a theater contains 70 rows of 100 seats each. Using an array where applicable, develop the logic for a program that allows a user to continuously enter each household size and then

a) Allows a user to continuously enter a row number and seat number until they enter an appropriate sentinel value for the row number in order to stop entering input. Each time the user enters a valid row and seat number, the program determines if that seat is available, and if so, marks it as reserved with an “X” (available seats are not marked in any way).

b) Once the user quits, the program outputs

   i) each row number followed by the seat numbers in that row that have been reserved

   ii) the total number of reserved seats

   iii) the total number of available seats

This seating map applies only to this particular show. For other shows, the seating map may contain a different number of rows and seats per row, and the program must be capable of being modified for those by editing only two lines of code.

This is what I have done so far- yes I know it's not alot but I'm just a little stuck on this. Please anyone help me, it's an emergency!!!

start

     Declarations

          num rowNumber

          num seatNumber

         

     output “Welcome to our Performance Theater Seat ”,

          Marker!”

     output “This program will allow you to enter ”,

          “a row and seat number to mark your spot ”,

          “in our theater room!”

     output “Please enter a row number”

     input rowNumber

     output “Please enter a seat number”

     input seatNumber

Explanation / Answer

First we need to declare a two dimentional array for it. E.g Show[i][j]

Where i will represent row number and j will represent seat number.

So we will Start the program like this

First we will loop through i and j and fill all seats with value 0 which means ALL seats are available.

num rownumber (Which will be i in this case)

num seatnumber(which will be j in this case)

output “Welcome to our Performance Theater Seat ”,

Then we will ask user for Row Number and Seat Number

We will loop through i and j for row and seat number and check if the value is 0 then fill it with X means now its occupied else display its already occupied

e.g If seat is vacant i.e

Seat[rownumber][Seatnumer]==0

Assign Seat[rownumber][seatnumer]=X

Once the user quits

We will loop through i and j for all rows and seats and display its value.

Which will be 0(Empty) and X(Occupied)

For another show we just need to declare another array e.g Show2[i][j] and everything works like same for that Show as well

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote