Question: Write a Java program to manage a parking area. The parking area is 100m. For each coming vehicle, the system should allocate a suitable space

 Write a Java program to manage a parking area. The parking

Write a Java program to manage a parking area. The parking area is 100m. For each coming vehicle, the system should allocate a suitable space for this car according to its length and the available spaces. When a car leaves the parking, your system should mark its space as free. If two contiguous spaces are free you should merge them. There are 4 types of vehicles: Truck with default length 7m, bus with default length 10m, car with default length 5m, and motorcycle with default length 2m. Your program should provide a menu to enable the user to manage the parking. The menu should include: adding a vehicle, leaving a vehicle, show parking status (to show free space and occupied spaces). When a vehicle comes the user should enter its type and id. Using car id the user can release it from the parking area. The user should also enter number of hours spent in the parking when release. Using calcMoney function in each different type of vehicle the program should calculates the money to be payed when release

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!