Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 5 ABC Movie Theater Write a C++ program to assign customer seats in a movie theater. ABC is a small movie theater with
Lab 5 ABC Movie Theater Write a C++ program to assign customer seats in a movie theater. ABC is a small movie theater with seats for 40 people in 8 rows of 5 seats each. So, the first thing you need to do is filling up the layout array. See the sample display below for a layout of the theater. The user enters the row (1-8) and the seat (A-E). The program checks the array to see if the seat is available. An X in the array indicates the seat is not available. If the seat is available, assign an X to that position in the array, If it's unavailable, display a message to the passenger. There are two types of membership: -Gold (Free popcorn and coke) -Silver (Free coke) Price of each ticket: -Gold member: $22 -Silver member: $20 -No member: $18 Note: You need another array to keep track of the sales. Continue processing requests until the user enters -1 for row. For each customer, the program should ask the row number, the seat letter and the type of the membership. (We have customers that are not members). After each customer display the layout table. And after-1 is entered for the row, display -number of seats sold. percentage occupied. -sales report. You need to include the following functions in your program. - Function to get the row and seat and membership: This function displays a prompt requesting the value for row. If-1 is not entered for the row, the function displays a prompt requesting the seat letter. The seat can be an upper or lowercase letter (Check how the toupper function works in Chapter Six, Display 6.9). This function is a call-by- reference since it needs to supply main with two values. Check Display 5.4 getNumbers function and Display 5.9 getInput function. These two functions are call-by-value. -Function to display the theater layout using the layout array. - Function to display the Sales Report, using the membership and the prices according to the membership. - Any additional functions that make the program more modular. Develop C++ program with the following new features: Arrays o Arrays and functions o User defined header files. Advice from the Instructor: As usual, code this problem in small steps, one function at a time. In main, the row and seat values need to be converted to indices for the layout array. The row value needs to be converted to a legal index from 0 to 7. You can use one statement to adjust the row index. The seat letter needs to be converted to a legal index from 0 to 4. Consider subtracting the ASCII value 65 from the value of the seat entered to change the index. It only takes one statement to adjust the column index using this technique. To produce the correct column results: 'A'-65-0 'B'-65 -1 C -65-2 'D'-65 = 3 'E' -65-4 o The advantage of arrays is the same in C++ as in Java - often reducing the amount of code you need. First make sure your program works correctly and then go back and see if you can write the code more efficiently. Sample Outputs: Sample Report: A B C AX CD A B C ABCDE ABCDE ABCDE ABCDE ABCDE **** Enter the row number: -1
Step by Step Solution
★★★★★
3.44 Rating (157 Votes )
There are 3 Steps involved in it
Step: 1
The instructions provided are for a lab exercise where a C program is to be written for managing a movie theater seating arrangement and ticket sales ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started