Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started