CIS 162 - Programming I - Section 5832
Programming Assignment #1
Due Thursday, May 4, 2006

Pentagon Parking Lot Manager

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:

Trucks: Senior Citizens: - no charge

Write a program that can be used by the company to calculate charges for a car 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 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.

Times should be entered as integer hours and minutes separated by a colon and followed by a space and the characters am or pm (example: 8:35 am, or 2:06 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 modules or functions. It could have a module to get the data, a module to compute the number of hours or minutes in the parking lot, a module to compute the parking fee, and a module to print the payment information.

Input data might look like these samples:

c
8:35 am 3:42 pm
t
10:15 am 5:02 pm