# Ever so lost! (Elevator Program)

• March 23rd, 2014, 09:11 PM
Hannah Smith <3
Ever so lost! (Elevator Program)
Hey guys! im really struggling to write a simple coding for an elevator simulator. The information here is:

1. The building has seven floors serviced by a single secure lift which can only accommodate one person

2.Each floor shows a display of which direction the lift is moving (Up, Down or Waiting) and where the lift is (at a particular floor, or between one floor and the next).

3. The lift has destination buttons inside for each floor. An authorized user will press the button for the destination floor and a display will indicate the direction the lift is moving (Up, Down) and where the lift is (at a particular floor, or between one floor and the next).

4. When there are no requests the lift will wait with the doors closed at the last floor it reached.

and if possible!

5.The lift is made secure by a keypad located on each floor. The user is required to enter their name at the keypad and this is checked to see if they are authorized to use the lift.

Thank You!!

Hannah xx
• March 23rd, 2014, 09:19 PM
dicdic
Re: Ever so lost! (Elevator Program)
Hi! Welcome to the forum. Please read this Announcements - What's Wrong With My Code?

So what have you tried now?
do you have any questions?
If you are expecting that someone here will do the program for you, I'm sorry but that's not gonna happen.
If you have codes, paste it here and ask specific question.
• March 24th, 2014, 12:34 AM
GregBrannon
Re: Ever so lost! (Elevator Program)
Welcome to the forum! Please read this topic to learn how to post code correctly and other useful info for new members.

This is a fun project! Good luck.
• March 24th, 2014, 08:46 AM
Hannah Smith <3
help needed!
How would i make my elevator program so that it goes to the the floor that is pressed? right now i can only move the elevator up and down by one :/

class Elevator {
static final int UP = +1, DOWN = -1, STOP = 0;
int firstFloor, lastFloor;
int actualFloor;
int actualWay;
boolean[] buttonPushed;

Elevator(int firstFloor, int lastFloor) {
this.firstFloor = firstFloor;
this.lastFloor = lastFloor;
actualFloor = firstFloor;
actualWay = STOP;
buttonPushed = new boolean[lastFloor - firstFloor + 1];

}

}
• March 24th, 2014, 08:54 AM
Norm
Re: help needed!
[code=java]
[/code]
to get highlighting and preserve formatting.

Quote:

goes to the the floor that is pressed
There isn't enough code shown to say.
It would be something like this:
Save the floor that was pressed
Move the elevator until it reaches that floor
• March 24th, 2014, 03:04 PM
GregBrannon
Re: help needed!
Give us some more info on this program. Is it graphical? Is it a console only program? How does the user indicate which floor to go to, etc? You just haven't told us enough about what this program is, does, doesn't do, should do, and so on. Any why a new thread? Didn't you have one on this topic already?

I'll merge them if I find it, because I think the other was better.