You are on page 1of 2

ES 26 MACHINE PROBLEM 1

Background: A shopping mall has a 3 parking lot with 10 car slots per parkin g lot. The customers park their cars to do some shopping. Trucks are parked to do some deliveries. Buses from a field trip are parked for souvenir buying The management uses two different rates for each type of vehicle s. The following matrix is used: Type First Rate Second Rate Car Php 0 for first 3 hours Php 25 after 3 hours Truck P25 for first 2 hours P 50 after 2 hours Bus P50 for first hour P75 after 1 hour

There are no fractional charges, the parking time must be rounde d up to the next hour before calculating the charge. No vehicle is allowed to stay in the parking lot later than the midnight; it wil l be towed away. TECHNICAL SPECIFICATIONS: Your task is to create a program that simulates the parking lots based on the ab ove mentioned rules and with the following specifications: A character will be chosen to determine the type of the vehicle: C or c for cars B or b for buses, T or t for trucks The user should be asked to (V)iew available slots, (P)ark, (E)xit the parki ng lot and (Q)uit the parking program An integer between 1 and 3 showing the parking lot area. An integer between 1 and 10 showing the slot on the parking lot. An integer between 0 and 24 showing the hour the vehicle entered and left the lot. An i nteger between 0 and 60 showing the minute the vehicle entered and left the lot. The user should be asked if s/he wants to continue the task chosen after eac ,

h task done. A y or Y character allows the player to continue doing the task. The user should be allowed to do the task until s/he enters other characters. Task continuation would allow the user to enter the parking lot, slot, type, and time for the next vehicle. Two vehicles can t park on the same slot given the same parking lot. A vehicle can t exit a slot where nothing is parked. Upon exit,a parking lot charge should be printed. When the parking lot is already full or the parking slot is already occupied , notify the user. The user should not have numbers that are out of range, and should not exceed the number of values required. In these case s, the player should be warned and given another chance to enter another value. Divide your program into functions. Use descriptive names for your functions and variables but do not overdo it. Additional enhancements to your program can be added at your discretion.

You might also like