Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C + + , Write a Theater Seating program that can be used by a small theater to sell tickets for performances. The theater

In C++, Write a Theater Seating program that can be used by a small theater to sell tickets for
performances. The theaters auditorium has 15 rows of seats, with 30 seats in each row (a twodimensional array). All seats in a given row are the same price, but different rows have
different prices. The program should display a screen that shows which seats are available and
which are taken.
Here are the tasks the program should accomplish:
1. Menu-Driven Program: Implement a menu-driven program offering options like
displaying the seating chart, seating prices, updating prices, ticket requests, sales
reports, and program exit.
Ensure user input validation for numbers outside the menu range.
2. Main Function and Program Functions: The main() function should display the menu
and handle user choices using a switch statement by calling each corresponding option
from separate functions.
3. Seat Prices: Initialize prices in a separate array or read from a text file like SeatPrices.txt.
For example:double seatprice[15]={30.0,30.0,30.0,30.0,20.0,20.0,20.0,20.0,12.0,
12.0,12.0,12.0,8.0,8.0,8.0};
Alternatively, write these initialized values onto a text file named SeatPrices.txt (See the
below).
4. Operation Loop: Keep the program running until the user chooses to exit (option 6).
5. Display Seating Chart: Implement a function to display available and taken seats,
represented as # and *, respectively.
For example, the following screen shows a char depicting each seat in the theater. Seats
that are taken are represented by an * symbol, and seats that are available are
represented by a # symbol. Initially all seats are available.
6. Display/Update Seat Prices: Offer options to display or update seat prices using
functions and possibly writing/reading from a file. It will be saving and loading data from
a file.
7. Ticket Purchase: Allow users to purchase tickets by selecting the number of seats, row
number, and seat number. Validate input to ensure seats exist and are available.
Also, give the user an option to view the chart of available seats before making any
selections.
a. The program should ask if the user wishes to purchase these seats.
b. Every time a ticket or group of tickets are purchased, the program should
display/keep a total of all tickets sales and update the seating chart.
Input Validation: When tickets are being sold, do not accept row or seat
numbers that do not exist. When someone requests a particular seat, the
program should make sure that seat is available before it is sold.
8. Sales Tracking: Keep track of total ticket sales, updating the sales report whenever
tickets are sold.
9. Sales Report: Provide an option to view a detailed sales report showing a list of how
many seats have been sold, how many seats are still available, and how much money
has been purchased so far for the sold seats.
10. Pointer Notation: Optionally, demonstrate pointer notation in functions instead of
array notation for added proficiency.
Function Documentation:
For every function, include a comment stating its name, purpose, required input, and provided
output (if any).
Code Sections:
Comment above major code sections (e.g., loops, if statements) to explain their purpose or logic

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions