Data Structures and Algorithms in Java

K

kiamkhai

How to write a program that can simiulate a car-parking garage that can

handle unlimited number of cars. The garage is very narrow such that
its' width can accomodate only one car. There is only one entry point
to the garage at one of its end where the car can be parked or taken
out of the garage. Your car parking garage consists of two garages
where only one of the garage is used as the parking area. The other
garage is used as temporary area for the other cars that is blocking
the car that need to move out. The other cars moved to the temporary
garage will be stored back to the main garage once the intended car is
taken out.


Input file:


A,ABA1234
A,ABC6789
-
-
D,ABC6789
A,ZXC2345
-
A,QWE3456
-
D,ZXC2345
-
-
X


Each line of input represent 1 minute of time. The input file will
consist of 60 lines and will be terminated by an marker X.
 
L

Luke Webber

First, don't multipost. It's not polite, and it wastes people's time.

Second, why should we waste our time solving non-existent problems. The
garage you describe can't possibly exist, except in your teacher's mind.
Hopefully, the solution exists in the same space. So ask your teacher
for the solution, because nobody here is going to do your homework for you.

Luke
 
C

Chris Smith

Luke Webber said:
Second, why should we waste our time solving non-existent problems. The
garage you describe can't possibly exist, except in your teacher's mind.
Hopefully, the solution exists in the same space. So ask your teacher
for the solution, because nobody here is going to do your homework for you.

On the other hand, someone here might help with any problems in
understanding that are preventing you from completing your homework.
It's your job, though, to identify what those problems are and ask for
specific help. As a rule of thumb, if your question has the word "car"
or "garage" in it, you haven't done the job yet.

If you really just have no clue how to get started, then talking to your
teacher/professor is the way to go.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top