Question
Develop a functional flowchart and then write a menu-driven C++ program, using control constructs and user-defined functions, to solve for the following problem. (Note: declare
Develop a functional flowchart and then write a menu-driven C++ program, using control constructs and user-defined functions, to solve for the following problem. (Note: declare the parking fee schedule in const variables. Never use the bare bone constant values shown)
The sign on the attendant's booth at the UH parking lot is:
UH Visitors Parking
Cars: First 1 Hours: Free
Next 2 hours: $ 2.00 per hour
Next 5 hours: $ 1.0 per hour
Thereafter: $ 0.50 per hour (more than 8 hours)
Motorcycles: First 1 hour: $ 1.00
Next 5 hours: $ 0.50 per hour
Next 8 hours: $ 0.25 per hour
Thereafter: $ 0.10 per hour (more than 14 hours)
Senior Citizens: Free
Upon execution of the program, the screen will be cleared and the following menu will appear at the top of the screen, properly centered:
Help Cars Motorcycles Senior Citizens Quit
H or h (for Help) option will briefly explain how the program should be used. Display of the parking fees shown above along with explanatory notes will help here. Once the user finishes reading the help screen(s), striking any key (strike a key followed by Enter key) will clear the screen and the menu is displayed again. The text for this help menu should be read from an ASCII text file.
C or c (for Cars) option will prompt the user for the number of minutes a vehicle has been in the lot. The program should then compute the appropriate charge and display the ticket on the monitor for the customer, as well as writing/adding the same to an ASCII file called parking_Charges. Any part of an hour is to be counted as a full hour (e.g., 65 minutes will be two hours.) Once the user finishes viewing the ticket, striking any key will clear the screen and the above menu is displayed again.
M or m (for Motorcycles) option will prompt the user for the number of minutes a vehicle has been in the lot. The program should then compute the appropriate charge and display the ticket on the monitor for the customer, as well as writing/adding the same to an ASCII file called parking_Charges. Any part of an hour is to be counted as a full hour (e.g., 45 minutes will be one hour.) Once the user finishes viewing the ticket, striking any key will clear the screen and the menu is displayed again.
S or s (for Senior Citizens) option will prompt the user for the number of minutes a vehicle has been in the lot. The program performs no computations. The ticket should show $0.00, and this information
should be written/added to an ASCII file called parking_Charges. Once the user finishes viewing the ticket, striking any key will clear the screen and the menu is displayed again.
Q or q (for Quit) option will clear the screen and returns the control to the programmer's IDE.
Test your program with the values shown below.
For option C, c : 0, 45, 85, 120, 140, 360, 960, 1050, and 1510 minutes
For option M, m : 0, 55, 60, 120, 155, 175, 180, 220, 850, and 1550 minutes
For option S, c : 0, 200, and 380 minutes
Of course, your program will work for other values within the integer boundary.
NOTES(PLEASE READ VERY CAREFULLY):
NO global declarations of VARIABLES allowed in any program that you develop in this course.
Full function prototyping is required. Functions may call other functions, as needed, to facilitate modular programming.
Illegal menu selection must be handled properly without terminating the program.
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