Question: Revise the if statement in the ElevatorSimulation 2 program below to have a single if statement with a complex condition. * / public class ElevatorSimulation
Revise the if statement in the ElevatorSimulation program below to have a single if statement with a complex
condition.
public class ElevatorSimulation
public static void mainString args
Scanner in new Scanner
System.in;
System.out.printFloor: ;
if inhasNextInt
Now we know that the user entered an integer
int floor innextInt;
if Your code goes here
System.out.printlnError: Invalid floor number";
else
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
