Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Ever so lost! (Elevator Program)

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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


  2. #2
    Member
    Join Date
    Oct 2013
    Location
    Manila, Philippines
    Posts
    285
    My Mood
    Amused
    Thanks
    6
    Thanked 64 Times in 61 Posts

    Default 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.

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default 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.

  4. #4
    Junior Member
    Join Date
    Mar 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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];

    }

    }

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: help needed!

    Please edit your post and wrap your code with code tags:
    [code=java]
    YOUR CODE HERE
    [/code]
    to get highlighting and preserve formatting.

    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
    If you don't understand my answer, don't ignore it, ask a question.

  6. #6
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default 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.

Similar Threads

  1. I'm so lost
    By Adam Appleby in forum What's Wrong With My Code?
    Replies: 8
    Last Post: March 23rd, 2014, 05:12 AM
  2. Starting a Slideshow Program... Lost
    By DrumKitt87 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 1st, 2010, 07:31 AM
  3. Help, please. I'm lost
    By Borb in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 17th, 2010, 08:50 PM
  4. I'm lost
    By stoptheerrors in forum What's Wrong With My Code?
    Replies: 2
    Last Post: August 31st, 2010, 08:47 AM
  5. Im lost....
    By brale76578 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: August 31st, 2010, 08:09 AM

Tags for this Thread