Question: Write a program in C to assign seats of a movie theater (capacity: 200 seats). Your program should display the following menu of alternatives: Please
Write a program in C to assign seats of a movie theater (capacity: 200 seats). Your program should display the following menu of alternatives:
Please type 1 for "section A, $50/ticket" type 2 for "section B, $70/ticket", and type 3 for "section C, $80/ticket". If the user types 1, then your program should assign a seat in the A section (seats 150). If the user types 2, then your program should assign a seat in the B section (seats 51100). If the user types 3, then your program should assign a seat in the C section (seats 101200). Your program should then ask for the number of tickets. Finally the program prints ticket/tickets individually indicating the seat number and the section of each ticket and then prints the receipt indicating the total cost. Use a single-subscripted array to represent the seating chart of the theater. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding element of the array to 1 to indicate that the seat is no longer available. Your program should, of course, never assign a seat that has already been assigned. When a section is full, your program should ask the user if it is acceptable to be placed in other sections. If yes, then make the appropriate seat assignment. If no, then print the message "We are booked."
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
