GENERAL INSTRUCTIONS - FOR LABIMPORTANT: Your programs MUST get input, create variables, do calculations, and format as instructed. Your programs must use functions where requested and should use...

1 answer below »
How can i do the functions


GENERAL INSTRUCTIONS - FOR LAB IMPORTANT: Your programs MUST get input, create variables, do calculations, and format as instructed. Your programs must use functions where requested and should use the right type of functions (see the important note below). Do not just hard-code the output to get the program to work, I WILL check the code. Do not forget to put your name, CSIS 135 and Lab# in comments at the top of each .cpp file and .h file. I will sometimes need to download and maybe print your code. Make sure that the prototypes and any named constants are in the header file, the function definitions in the implementation file, and have a separate file that has main. REGARDING PSEUDOCODE: Pseudocode is not required for this program. This is a more difficult program so doing pseudocode WILL HELP, but it’s your choice (or funeral). IMPORTANT NOTE: Make sure and use the required functions as indicated in the instructions for this program! NO GLOBAL VARIABLES – no exceptions. Programs with global variables will not be accepted (global constants are fine) HW #6 - Program #2 – Movie Theater Tickets (35 pts) Write a program that can be used by a small theater to sell tickets for performances. The theater’s auditorium has 15 rows of seats with 20 seats in each row. Use global constants put in the header file to specify the rows and columns. Step 1: The program should have a FUNCTION that displays a screen that shows which seats are available and which are taken. Seats that are taken should be represented by a # symbol and seats that are available should be represented by a * symbol. The first thing your program should do is initialize all of the seats to available (*) and display the seating chart. (HINT: seating chart should be a two dimensional character array.) Below is an example of the seating chart with all seats initialized to available. Seats: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Row 0 * * * * * * * * * * * * * * * * * * * * Row 1 * * * * * * * * * * * * * * * * * * * * Row 2 * * * * * * * * * * * * * * * * * * * * Row 3 * * * * * * * * * * * * * * * * * * * * Row 4 * * * * * * * * * * * * * * * * * * * * Row 5 * * * * * * * * * * * * * * * * * * * * Row 6 * * * * * * * * * * * * * * * * * * * * Row 7 * * * * * * * * * * * * * * * * * * * * Row 8 * * * * * * * * * * * * * * * * * * * * Row 9 * * * * * * * * * * * * * * * * * * * * Row 10 * * * * * * * * * * * * * * * * * * * * Row 11 * * * * * * * * * * * * * * * * * * * * Row 12 * * * * * * * * * * * * * * * * * * * * Row 13 * * * * * * * * * * * * * * * * * * * * Row 14 * * * * * * * * * * * * * * * * * * * * Step 2: Each row in the auditorium has a different ticket price. So tickets in row 0 may be 5.00 each and tickets in row 1 may be 10.00 each. The price of tickets for each row should be stored in a one dimensional array. Use array initialization (i.e. double prices[] = {40.0, 40,0, …};) and do NOT have user input the prices! Step 3: Your program should have variables tracking the total number of tickets sold and the total revenue for all tickets sold. Step 4: Your program should allow the user to sell tickets one at a time. The user should be able to sell as many tickets as they would like (you need a loop for this). Do this with some sort of prompt or menu asking the user if they would like to sell another ticket. Don’t forget to validate input data if needed. To allow the user to sell a ticket your program should have the user enter a row number and a seat number for the ticket they would like to sell. The program should do four things with this information: 1. It should check to see if the seat is available. If the seat is taken the program should not allow the user to sell the ticket. If this happens, print a message to the user saying the ticket is not available and prompt the user to see if they would like to sell another ticket. 2. If the seat is available the program should update the seating chart by putting a taken symbol (#) in that seat’s position in the chart. 3. The program should then look up the row price for the seat sold. Your program should have a variable tracking the total revenue, the price of the seat sold should be added to this total after each sale. 4. Your program should have a variable tracking the total tickets sold. The next thing your program should do when selling a ticket is update the total tickets sold. Step 5: Once the user is finished selling tickets print out an updated seating chart followed by the total tickets sold and the total revenue generate from those tickets. NOTE: You are required to use two arrays in this program, one for the seating chart and one to store the prices for each row. You are also required to use one function: one to display the seating chart. You may use other functions if you want to but they are not required. Some DATA to Test Your Program With NOTE: This is DATA to TEST your program with; you may use different values as long as higher numbered rows are cheaper. Initialize row price array when defined using initialization list (required). Row # Ticket Price 0 40.00 1 40.00 2 35.00 3 35.00 4 35.00 5 30.00 6 30.00 7 25.00 8 25.00 9 25.00 10 12.50 11 12.50 12 12.50 13 9.50 14 9.50 Sell the Following Tickets (row, seat): (0,8), (0,9), (0,10), (0,18), (0,19), (2, 5), (2,6), (5,0) ,(5,1), (5,2), (7,7),(7,8), (9,1),(9,9),(9,10),(11,11),(12,13),(12,14),(12,15), (14,4),(14,5) (14,6),(14,7),(1,0) Output with this test data: 1. Buy Ticket 2. Display seating and sales 0. Quit Selection: 1 Seat desired (row, column): 14 7 Seat already taken Buy another ticket (y = yes)? y Seat desired (row, colum): 16 8 Out of range Buy another ticket (y = yes)? y Seat desired (row, column): 1 0 Charge $40.00 Buy another ticket (y = yes)? n 1. Buy Ticket 2. Display seating and sales 0. Quit Selection: 2 UPDATED SEATING CHART AND SALES INFO: Seats: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Row 0 * * * * * * * * # # # * * * * * * * # # Row 1 # * * * * * * * * * * * * * * * * * * * Row 2 * * * * * # # * * * * * * * * * * * * * Row 3 * * * * * * * * * * * * * * * * * * * * Row 4 * * * * * * * * * * * * * * * * * * * * Row 5 # # # * * * * * * * * * * * * * * * * * Row 6 * * * * * * * * * * * * * * * * * * * * Row 7 * * * * * * * # # * * * * * * * * * * * Row 8 * * * * * * * * * * * * * * * * * * * * Row 9 * # * * * * * * * # # * * * * * * * * * Row 10 * * * * * * * * * * * * * * * * * * * * Row 11 * * * * * * * * * * * # * * * * * * * * Row 12 * * * * * * * * * * * * * # # # * * * * Row 13 * * * * * * * * * * * * * * * * * * * * Row 14 * * * * # # # # * * * * * * * * * * * * TOTAL TICKETS SOLD: 24 TOTAL REVENUE: $ 613.00 1. Buy Ticket 2. Display seating and sales 0. Quit Selection: 3 Invalid selection 1. Buy Ticket 2. Display seating and sales 0. Quit Selection: 0 Submit the header, implementation and main file Test Case \n 1. Buy Ticket\n 2. Display seating and sales\n 0. Quit\n \n Selection: 1ENTER Seat desired (row, column): 1 8ENTER Charge $40.00\n Buy another ticket (y = yes)? yENTER Seat desired (row, column): 9 13ENTER Charge $25.00\n Buy another ticket (y = yes)? yENTER Seat desired (row, column): 15 19ENTER Out of range\n Buy another ticket (y = yes)? yENTER Seat desired (row, column): 12 22ENTER Out of range\n Buy another ticket (y = yes)? yENTER Seat desired (row, column): 14 19ENTER Charge $ 9.50\n Buy another ticket (y = yes)? nENTER \n 1. Buy Ticket\n 2. Display seating and sales\n 0. Quit\n \n Selection: 2ENTER Seats:   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19\n Row  0   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  1   *  *  *  *  *  *  *  *  #  *  *  *  *  *  *  *  *  *  *  *\n Row  2   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  3   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  4   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  5   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  6   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  7   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  8   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  9   *  *  *  *  *  *  *  *  *  *  *  *  *  #  *  *  *  *  *  *\n Row 10   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row 11   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row 12   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row 13   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row 14   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  #\n TOTAL TICKETS SOLD: 3\n TOTAL REVENUE:  $  74.50\n \n 1. Buy Ticket\n 2. Display seating and sales\n 0. Quit\n \n Selection: 1ENTER Seat desired (row, column): 1 8ENTER Seat already taken\n Buy another ticket (y = yes)? yENTER Seat desired (row, column): 1 9ENTER Charge $40.00\n Buy another ticket (y = yes)? yENTER Seat desired (row, column): 5 11ENTER Charge $30.00\n Buy another ticket (y = yes)? nENTER \n 1. Buy Ticket\n 2. Display seating and sales\n 0. Quit\n \n Selection: 2ENTER Seats:   0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19\n Row  0   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  1   *  *  *  *  *  *  *  *  #  #  *  *  *  *  *  *  *  *  *  *\n Row  2   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  3   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  4   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  5   *  *  *  *  *  *  *  *  *  *  *  #  *  *  *  *  *  *  *  *\n Row  6   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  7   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  8   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row  9   *  *  *  *  *  *  *  *  *  *  *  *  *  #  *  *  *  *  *  *\n Row 10   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row 11   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row 12   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row 13   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *\n Row 14   *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  #\n TOTAL TICKETS SOLD: 5\n TOTAL REVENUE:  $ 144.50\n \n 1. Buy Ticket\n 2. Display seating and sales\n 0. Quit\n \n Selection: 0ENTER
Answered Same DayNov 30, 2022

Answer To: GENERAL INSTRUCTIONS - FOR LABIMPORTANT: Your programs MUST get input, create variables, do...

Aditi answered on Nov 30 2022
31 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here