Question
Plan and code a program utilizing one or more repetition structures to solve the following problem: Write a program for Pentagon Parking Lot for all
Plan and code a program utilizing one or more repetition structures to solve the following problem:
Write a program for Pentagon Parking Lot for all customers that use the lot during the day. The lot opens at 6:00 AM and closes at 10:00 PM. Charges for vehicles are based upon the following rates:
Cars: First 2 hours Free
Next 3 hours $1.00 per hour
Next 11 hours $0.50 per hour
Trucks: First 2 hours Free
Next 2 hours $2.00 per hour
Next 12 hours $1.00 per hour
Senior Citizens: No charge
code, compile and run a program containing REPETITION structures
check and handle invalid input data using a repetition structure
output correct, aligned, formatted , readable output
Have the user enter a character designation for rate of charge (C, T, S), the starting time and ending time (in military time) for parking lot use. Determine the total number of hours. (Any part of an hour is to be counted as a full hour.) Compute the appropriate charge and print out a ticket for each customer. Be sure to check for invalid data and handle it appropriately. Loop for multiple vehicles - have the user enter Y or N to repeat for another vehicle for each loop iteration. Print out the total fees for each type of rate charged during the entire day.
Input
Rate designation (C, T, S), starting time, ending time.
Output
Itemized listing of charges for each vehicle, and an itemized summary of all charges for the day. Be sure to align all decimal points.
Note
Adequately check entered data for validity. Use adequate test data to process all valid data and representative data to show how your program handles invalid data.
Label all output clearly. Be sure your output file contains user prompts and what was entered by the user in addition to the results of your program processing.
Be sure to include adequate error handling in your program and error data when you run the program to demonstrate error handling.
Output
Show an itemized listing of charges for each vehicle, aligning all decimal points.
At the end of the day, output an itemized summary of all charges for the day. Print out the total number of cars, the total number of trucks, and the total number of seniors. Print out the total income from all the cars, and the total income from the trucks. Print out the total fees received for the entire day.
Step by Step Solution
3.41 Rating (167 Votes )
There are 3 Steps involved in it
Step: 1
include include include using namespace std int main int carscharged 0 truckscharged 0 seniorscharged 0 int carshours 0 truckshours 0 seniorshours 0 double carsfees 000 trucksfees 000 seniorsfees 000 ...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