Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Influxdb Database A Comprehensive Guide To Learn Influxdb Database

Authors: Cybellium Ltd ,Kris Hermans

1st Edition

B0CNGGWL7B, 979-8867766450

More Books

Students also viewed these Databases questions