Question: Please edit the java code below. There is not a 13 floor at all. Please include: if(floor > 20) System.out.print(error) else if (floor 13) {

Please edit the java code below. There is not a 13 floor at all. Please include:

if(floor > 20)

System.out.print("error")

else if (floor <= 0)

System.out.print("error")

else if (floor == 13)

System,out.print("error")

__________________________

This is the code you will have to edit below

import java.util.Scanner;

/**

*THis program simulates a elevator panel that skips the 13th floor.

* @author KillaQ

*

*/

public class ElevatorSimulation {

public static void main(String[] args)

{

Scanner in = new Scanner(System.in);

System.out.print("Floor: ");

int floor = in.nextInt();

//Adjust floor if necessary

int actualFloor;

if(floor > 13)

{

actualFloor = floor - 1;

}

else

{

actualFloor = floor;

}

System.out.println("The elevator will travel to the actual floor " + actualFloor);

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!