Write an expression that will cause "Foot or more" to print if the value of numInches is greater than or equal to 12.
import java.util.Scanner;
public class EqualityAndRelational {
public static void main (String [] args) {
int numInches;
Scanner scnr = new
Scanner(System.in);
numInches = scnr.nextInt(); //
Program will be tested with values: 10, 11, 12, 13.
if (/* Your solution goes
here */) {
System.out.println("Foot or more");
}
else {
System.out.println("Less than a foot");
}
}
}
import java.util.Scanner; public class EqualityAndRelational { public static void main (String [] args) { int numInches; Scanner scnr = new Scanner(System.in); numInches = scnr.nextInt(); // Program will be tested with values: 10, 11, 12, 13. if (numInches>=12) { System.out.println("Foot or more"); } else { System.out.println("Less than a foot"); } } }
Get Answers For Free
Most questions answered within 1 hours.