Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

((C++)) PLEASE FOLLOW THE OUTPUT THAT I HAVE AT THE BOTTOM. Please make sure the output is as close to what I have pasted below

((C++)) PLEASE FOLLOW THE OUTPUT THAT I HAVE AT THE BOTTOM. Please make sure the output is as close to what I have pasted below as possible. 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.

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: The seating chart should be a two dimensional 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. Your program should have a FUNCTION that asks the user to enter a ticket price for each row. The price of tickets for each row should be stored in a one dimensional array.

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 you need to.

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:

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. 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. 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. 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 two functions: one to display the seating chart and one to read in the price per row data and store it in the array with the prices for each row in it. You may use other functions if you want to but they are not required.

INPUT:

40.00 40.00 35.00 35.00 35.00 30.00 30.00 25.00 25.00 25.00 12.50 12.50 12.50 9.50 9.50 1 20 15 1 0 8 1 0 9 1 0 10 1 0 18 1 0 19 1 2 5 1 2 6 1 5 0 1 5 1 1 5 2 1 7 7 1 7 8 1 9 1 1 9 9 1 9 10 1 11 11 1 12 13 1 12 14 1 12 15 1 14 4 1 14 5 1 14 6 1 14 7 1 0 8 1 0 9 q 

OUTPUT:

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 * * * * * * * * * * * * * * * * * * * * Please enter a ticket price for each row. 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 : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Row # must be between 0 and 14. Please enter again: Row # must be between 0 and 14. Please enter again: Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Invalid selection. Please try again. MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : Please enter a row number and seat number for the ticket: Row # : Seat # : Sorry. The ticket is not available for this seat. MOVIE THEATER MENU ------------------ 1) Sell a ticket Q) Quit program Please make a selection : 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 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Samsung Galaxy S23 Ultra Comprehensive User Manual

Authors: Leo Scott

1st Edition

B0BVPBJK5Q, 979-8377286455

More Books

Students also viewed these Databases questions

Question

2. Outline the functions of nonverbal communication

Answered: 1 week ago