The sign on the attendant's booth at the Pentagon parking lot is:
PENTAGON VISITOR PARKING
(open 6:00 am to 10:00 pm)
Cars:
Write a program that can be used by the company to calculate charges for a car or truck to use the lot. From a visitor it should accept as input a one-character designator (c, t, or s for car, truck or senior), the time a vehicle has entered the lot, and the time the vehicle left. The program should then compute the appropriate charge for the customer and print the charge on the screen. Hours should be counted from the time the vehicle enters until it leaves the lot, and any part of an hour is to be counted as a full hour.
Entered times should have integer hours and integer minutes and the characters am or pm. The lot opens at 6:00 am and closes at 10:00 pm. It should be assumed that cars will be removed before closing and not stay overnight. Your program should include appropriate error checking. It should also include appropriate summary information to make running the program clear and user friendly. It should also include appropriate remark statements for documentation.
The program must include a class with the appropriate member functions to accomplish the tasks. It could have a method to get the data, a method to compute the number of hours or minutes in the parking lot, a method to compute the parking fee, and a method to print the payment information.
Input data might look like this sample:
Car, truck, or senior?
c
Enter time?
8:35 am
Exit time?
3:42 pm