A Java Program
$30 USD
Paid on delivery
A parking garage consists of a single lane which can hold up to 7 cars.
Cars arrive at the south end of the garage, and leave from the north
end. If an owner arrives to pick up the car that is not the northernmost,
then all cars to its north are moved out, owner's car is driven out,
and the other cars are restored in the same order that they were in
originally. If there is no room for an arriving car in the garage, then
it waits in a Waiting Line. A car waits in the waiting line until there is
room in the garage or the car departs from the waiting line itself. Cars
move from the waiting line into the garage on a first-come-first-served basis.
In this assignment, you are required to simulate the operation of such
a parking garage. Simulation means that your program should go through
all the steps that will be carried out in the actual garage without omission.
Write a Java program that reads a sequence of input lines from an input
file (prompt the user to specify the name of the input file), each input
line containing an "A" for arrival and a "D" for departure, along with the
license plate number of the car. Cars are assumed to arrive and depart in
the order specified by the input. For each car, you must keep a count of
how many times it was moved out of the garage. So, when a car A moves out
of the garage to allow another car B behind it to move out, that counts as
a move out of the garage for that car A, also. Departure from the waiting
list is not counted as a move out of the garage.
You must use a linked implementation of the list for the waiting list,
a double-ended-queue for the garage (in fact, this is an output-restricted
deque), and an array implementation of stack (I know you will need this).
An additional operation allowed on this deque is "find" that returns a
boolean value depending on whether the car is in the garage or not.
You are perfectly free to pick up codes for these data structures from the
text but no where else. Even if you use the code from the book, make sure
that you understand its implementation perfectly well. Spending time in
designing a good solution will help you tremendously.
For every operation, arrival or departure, you must output the operation
performed on the garage, which car was involved, and the state of the
garage and the waiting line (if not empty) after that arrival or
departure. For departing cars, in addition to the above information,
output the number of times that car was moved out of the garage.
Project ID: #1417511
About the project
Awarded to:
2 freelancers are bidding on average $35 for this job
Hello.., I could handle your program. Please get back to me with further details and implementation instructions