Question: Complete the if - else statement to output Under - 3 0 if the value of userVal is under - 3 0 . Otherwise,

Complete the if-else statement to output "Under -30" if the value of userVal is under -30. Otherwise, output "-30 or more".
Ex: If the input is -32, then the output is:
Under -30 import java.util.Scanner;
public class Relational {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
int userVal;
userVal = scnr.nextInt();
if (/* Your code goes here */){
System.out.println("Under -30");
}
else {
System.out.println("-30 or more");
}
}
}

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!