Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem statement: A person is eligible to be a US Senator who is at least 30 years old and has been a US citizen for
Problem statement: A person is eligible to be a US Senator who is at least 30 years old and has been a US citizen for at least 9 years. Write a version of a program Congress.java to obtain age and length of citizenship from the user and print out if a person is eligible to be a Senator or not. A person is eligible to be a US Representative who is at least 25 years old and has been a US citizen for at least 7 years. Modify your program Congress.java, so it obtains age and length of citizenship and prints whether a person is eligible to be a US Representative only, or is eligible for both offices, or is eligible for neither. . . Create a class in the project called Congress. [If using repl.it class name as Main is fine] Write a main method in Congress.java. Add the comment block, personalize the structure given in the Program Structure Program details You have to write a program to accept age and years of citizenship from the user (Use Scanner class). o Using conditional statements give appropriate condition as given in the Problem statement above to check if the user is eligible to run for US Representative only, eligible for both US Representative and US Senator, or not eligible to run as any of those positions. o Display the results. The Program should output: O Any one of the following based on the conditions given in the program Eligible to run for US Representative only Eligible to run for US Representative and US Senator. Not Eligible to run for both positions
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started