Answer:
if(patronAge>=55){
System.out.println("Senior Citizen");
}
else{
System.out.println("Not Senior Citizen");
}
Step-by-step explanation:
Using if and else statements, the condition is checked.
The if statement will evaluate to true if the patronAge is greater or equal to 55 and the statement System.out.println("Senior Citizen"); will be executed.
If this this condition is not true, the else part System.out.println("Not Senior Citizen"); will be executed
A complete Java code snippet is given below that prompts user to enter an age and prints the corresponding message
import java.util.Scanner;
public class num6 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter Patron Age");
int patronAge = in.nextInt();
if(patronAge>=55){
System.out.println("Senior Citizen");
}
else{
System.out.println("Not Senior Citizen");
}
}
}