Question: Part 1 : Function to Prompt for a Filepath ( 0 5 points ) Below is the function prototype of the function to implement. string
Part : Function to Prompt for a Filepath points
Below is the function prototype of the function to implement.
string promptForFilename;
This function should continue to prompt the user to enter a filename until a valid one is entered or the word "exit" has been entered. A valid filename must end with txt and cannot contain any spaces. This function returns either a valid filename once one has been entered OR the string "EXIT" if the user enters exit for the filename.
Note: This function DOES NOT check if the file exists, only that the filename is valid.
Part : Function to Populate Theater Information from a File Stream points
Below is the function prototype of the function to implement.
void processTheaterInformationfstream& fileInput, Theater& myTheater;
Previously, the program read from a file containing theater information. Unlike the previous theater file, the program theater file will now have indivdual theater screens listing the theater room name, how many parking spots there are and what movie is being shown. Your job is to write a function that takes information from the theater file and processes it into the myTheater structure. The function requirements are listed below:
The function should continue to ask the user for a filename until a valid filename is provided AND the file already exists.
If the user enters "exit" for the filename prompt, it should exit the function early stating Exiting function due to early exiting of file prompt".
The function is responsible for BOTH opening and closing the file stream.
The file will always have the following:
Theater name
Number of Theater Rooms
Theater Rooms
or more theater room information where each Room Name, Parking Spots, Movie Name is on it's own line.
Pricing:
Adult Ticket Price
Senior Ticket Price
Child Ticket Price
Member Ticket Price
Memership Fee
Note: The comments will not be in the text file provided, there are just here to provide clarity.
Code Block : theater.txt
Route Theater Theater name
Number of Theater Rooms
Theater Rooms
Alto HatchbacktotheFuture Room Name, Room Spots, Room Movie
Nexon GuardiansoftheFordGalaxy Room Name, Room Spots, Room Movie
Vento NoCountryforOldsmobiles Room Name, Room Spots, Room Movie
Pricing
Adult Ticket Price
Senior Ticket Price
Child Ticket Price
Theater Member Ticket Price
Membership Fee
Part : Function to Display A Provided Menu points
Below is the function prototype of the function to implement.
void displayMenustring szMenuName, string szChoicesArr int iChoices;
This function should display the menu choices that it is provided as an array to the function. The format of the menu is the exact same as the previous program, where menu choices are displayed starting at counting up The last menu option should always be displayed as as it is used to exit the menu.
Note: This function is used to both display the normal menu and the admin menu so don't just hardcode the menu. Do not handle user input in this function.
Example:
Menu
Display theater information
Display now showing
Buy tickets
Refund tickets
Admin Menu
Exit program
Part : Function to Display Theater Information points
Below is the function prototype of the function.
void displayTheaterInfoconst Theater myTheater;
This function should display the theater information provided by the file. This theater information display format should be in the exact same format as program
Example:
Theater Information
Name: Route Theater
Rooms:
Total seats:
Part : Function to Display Movies Now Showing points
Below is the function prototype of the function to implement.
void displayNowShowingconst Theater myTheater;
This function program should display the movies the theater is now showing. This now showing display format should be displayed similar to displayMenu where each menu option is a movie. However, unlike displayMenu, the menu choices should begin a and not have a option.
Example:
Now Showing
Hatchback to the Future
Guardians of the Ford Galaxy
No Country for Oldsmobiles
Part : Function to Buy Tickets points
Below is the function prototype of the function to implement.
CustomerTicket buyTicketsTheater& myTheater;
This funcIf the customer bought theater membership with the purchase, the function should display "Please note: The membership fee
cannot be refunded.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
