I know this is gonna be an easy fix, but I can't see it! Why won't this work?
import java.util.Scanner;
public class Elevator
{
public boolean doorOpen=false;
public int currentFloor = 1;
public final int TOP_FLOOR = 5;
public final int BOTTOM_FLOOR = 1;
public static void main(String args[])
{
int op=0;
Scanner SO=new Scanner(System.in);
System.out.println("1-DOor Open \n 2-Door Close");
System.out.println("3-Go Up \n 4-Go Down");
System.out.println("5-To Select Desired Floor");
System.out.println("0-To Quit Program");
System.out.println("Your Option");
op=SO.nextInt();
}
public void openDoor()
{
System.out.println("Opening door.");
doorOpen = true;
System.out.println("Door is open.");
}
public void closeDoor()
{
System.out.println("Closing door.");
doorOpen = false;
System.out.println("Door is closed.");
}
public void goUp()
{
System.out.println("Going up one floor.");
currentFloor++;
System.out.println("Floor: " + currentFloor);
}
public void goDown()
{
System.out.println("Going down one floor.");
currentFloor--;
System.out.println("Floor: " + currentFloor);
}
public void setFloor(int desiredFloor)
{
while (currentFloor != desiredFloor)
{
if (currentFloor < desiredFloor)
{
goUp();
}
else
{
goDown();
}
}
}
public int getFloor()
{
return currentFloor;
}
public boolean checkDoorStatus()
{
return doorOpen;
}
}
thanks for any help!