Please complete number one on this page: https://www.lol-101.com/classrooms/introduction-to-java/4-3-how-to-run-part-of-code-under-certain-conditions. Feel free to modify the existing code to reach your answer or write your own program(for more practice), and then comment your solution here. If modifying the given program, replace the "..." in the if statement with the appropriate boolean expression to complete the program. Don't worry about the grey text that is either enclosed in /* and */ or started off with //, those are comments and do not affect the code.
top of page
bottom of page
import java.util.Scanner; /** This program simulates an elevator panel that skips the 13th floor. */ class Main { 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) // What's missing here? { actualFloor = floor - 1; } else { actualFloor = floor; } System.out.println("The elevator will travel to the actual floor " + actualFloor); } }