- 1

how to solve this problem ?

Vehicle parking problem Write a Java program to manage a parking area. The parking area is 100 m. Each vehicle comes 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. Truck = 15 $ per hour Bus = 15 $ per hour Car = 10 $ per hour Motorcycle = 5 $ per hour

5th Jan 2018, 5:40 PM
Muhammad Sayed Ahmed
Muhammad Sayed Ahmed - avatar
2 Answers
+ 1
Given how far you've gotten with your Java on this site, this problem is well beyond your ability to solve. If this is a homework assignment for a class you are taking at school, you should be able to get close. Start small get a piece working and add to it slowly. If it doesn't work and you can't figure out why, post your code and I will find your problem. Start by putting in the menu with a 4th option of exiting.
6th Jan 2018, 8:57 PM
John Wells
John Wells - avatar
0
Did you solve it?
21st Dec 2022, 12:29 PM
Eslam Mohamed
Eslam Mohamed - avatar