Answer:
import java.util.Scanner;
public class num1 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
//Prompt for the person's age
System.out.println("What is your age");
int age = in.nextInt();
//Prompt for the person's years of citizenship
System.out.println("What is your years of citizenship");
int yearsCitizenship = in.nextInt();
if(age >= 30 && yearsCitizenship >= 9){
System.out.println("You are Eligible to be a US senator");
}
if(age >= 25 && yearsCitizenship >= 7){
System.out.println("You are Eligible to be a US representative");
}
}
}
Step-by-step explanation:
Using Java Programming language
The scanner class is used to receive and store the persons age and year of citizenship
The first if statement is used to test if the age >= 30 and citizenship>=9 If this is true, it prints out You are Eligible to be a US senator. You are Eligible to be a US representative. Note that if the second condition is true, then the first is also true because to be eligible for senatorial also means you also meet the requirments for representative position