Answered step by step
Verified Expert Solution
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 rows of seats, with 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:
MenuDriven Program: Implement a menudriven 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.
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.
Seat Prices: Initialize prices in a separate array or read from a text file like SeatPrices.txt
For example:double seatprice
;
Alternatively, write these initialized values onto a text file named SeatPrices.txt See the
below
Operation Loop: Keep the program running until the user chooses to exit option
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.
DisplayUpdate Seat Prices: Offer options to display or update seat prices using
functions and possibly writingreading from a file. It will be saving and loading data from
a file.
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
displaykeep 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.
Sales Tracking: Keep track of total ticket sales, updating the sales report whenever
tickets are sold.
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.
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 eg loops, if statements to explain their purpose or logic
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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