Given an input integer 'n', your program must output a string. If 'n' is less than 5, output 'LOW'. If 'n' is exactly 5, output 'MID'. If 'n' is greater than 5, output 'HIGH'.
Conditional statement
Determining range of an integer: low, mid or high
Report a typo
Sample Input 1:
3Sample Output 1:
LOWSample Input 2:
5Sample Output 2:
MIDWrite a program in Java 17
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// Create a Scanner object to read the user input
Scanner scanner = new Scanner(System.in);
// Read an integer from the user
int n = scanner.nextInt();
// YOUR CODE HERE: If 'n' is less than 5, output 'LOW'. If 'n' is exactly 5, output 'MID'. If 'n' is greater than 5, output 'HIGH'.
}
}
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.