Question: import java.util.Scanner; public class UserNums { public static void main (String [] args) { int userNum1; int userNum2; Scanner input = new Scanner(System.in); userNum1 =
import java.util.Scanner; public class UserNums {
public static void main (String [] args) { int userNum1; int userNum2;
Scanner input = new Scanner(System.in); userNum1 = input.nextInt(); userNum2 = input.nextInt();
/* Your code goes here */
System.out.println("userNum2 is " + userNum2); }
}![import java.util.Scanner; public class UserNums { public static void main (String []](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4f50b8e684_54766f4f50b1640c.jpg)
import java.util.Scanner;
public class DetectSenior { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); int patronAge;
patronAge = scnr.nextInt();
/* Your solution goes here */
} }

CHALLENGE ACTIVITY 3.3.2: If-else statements. Jump to level 1 Print "userNum1 is negative." if userNum1 is less than 0. End with newline. Assign userNum2 with 1 if userNum2 is greater than 9. Otherwise, print "userNum2 is less than or equal to 9.". End with newline. 1 import java.util.Scanner; 2 public class UserNums { 3 4 public static void main (String [] args) 5 int user Num1; 6 int userNum2; 7 8 Scanner input = new Scanner(System.in); 9 userNum1 input.nextInt(); 10 userNum2 input.nextInt(); 11 12 /* Your code goes here * 13 14 System.out.println("userNum2 is " + userNum2); 15 } 16 17 } 2. Write an if-else statement that checks patronage. If 55 or greater, print "Senior citizen", otherwise print "Not senior citizen" (without quotes). End with newline. 1 test passed All tests passed 1 import java.util.Scanner; 2 3 public class DetectSenior { 4 public static void main (String [] args) { 5 Scanner scnr = new Scanner(System.in); 6 int patronAge; 7 8 patronAge scnr.nextInt(); 9 10 /* Your solution goes here */ 11 12 } 13 } Run Feedback
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
