Question: Part 1 : Function to Prompt for a Filepath ( 0 5 points ) Below is the function prototype of the function to implement. string

Part 1: Function to Prompt for a Filepath (05 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 2: Function to Populate Theater Information from a File Stream (10 points)
Below is the function prototype of the function to implement.
void processTheaterInformation(fstream& fileInput, Theater& myTheater);
Previously, the program read from a file containing theater information. Unlike the previous theater file, the program 3 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*
1 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 7.4.2: theater.txt
Route 66 Theater // Theater name
3// Number of Theater Rooms
*Theater Rooms*
Alto 30 Hatchback_to_the_Future // Room1 Name, Room1 Spots, Room1 Movie
Nexon 20 Guardians_of_the_Ford_Galaxy // Room2 Name, Room2 Spots, Room2 Movie
Vento 25 No_Country_for_Oldsmobiles // Room3 Name, Room3 Spots, Room3 Movie
*Pricing*
10.99// Adult Ticket Price
8.99// Senior Ticket Price
6.99// Child Ticket Price
5.99// Theater Member Ticket Price
6.00// Membership Fee
Part 3: Function to Display A Provided Menu (05 points)
Below is the function prototype of the function to implement.
void displayMenu(string 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 1 counting up. The last menu option should always be displayed as -1 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
*****************************
1. Display theater information
2. Display now showing
3. Buy tickets
4. Refund tickets
5. Admin Menu
-1. Exit program
*****************************
Part 4: Function to Display Theater Information (2.5 points)
Below is the function prototype of the function.
void displayTheaterInfo(const 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 2.
Example:
Theater Information
*****************************
Name: Route 66 Theater
Rooms: 3
Total seats: 75
*****************************
Part 5: Function to Display Movies Now Showing (2.5 points)
Below is the function prototype of the function to implement.
void displayNowShowing(const 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 0 and not have a -1 option.
Example:
Now Showing
*****************************
0. Hatchback to the Future
1. Guardians of the Ford Galaxy
2. No Country for Oldsmobiles
*****************************
Part 6: Function to Buy Tickets (30 points)
Below is the function prototype of the function to implement.
CustomerTicket buyTickets(Theater& myTheater);
This funcIf the customer bought theater membership with the purchase, the function should display "Please note: The membership fee
cannot be refunded.
Part 1 : Function to Prompt for a Filepath ( 0 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!