Question: [9] 25 points use file Congress.java Computer Science E-10a: Introduction to Computer Science Using Java. I Page 7 The candidate is NOT eligible for election

 [9] 25 points use file Congress.java Computer Science E-10a: Introduction to

[9] 25 points use file Congress.java Computer Science E-10a: Introduction to Computer Science Using Java. I Page 7 The candidate is NOT eligible for election to either the House of Representatives or the Senate. CONGRESS ELIGIBILITY Enter age of candidate: 47 The following requirement for membership In the Congress of the United States Enter years of U.S. citizenship: 8 are quoted from Article I of the Constitution of the United States: No Person shall be a Representative who shall not have attained to the Age of The candidate is eligible for election to the House of twenty-five Years, and been seven Years a Citizen of the United States, and Representatives but is NOT eligible for election to the who shall not, when elected, be an Inhabitant of that State in which he shall be Senate. chosen. No Person shall be a senator who shall not have attained to the Age of thirty CONGRESS ELIGIBILITY Years, and been nine Years a Citizen of the United States, and who shall not, when elected, be an Inhabitant of that State for which he shall be chosen. Enter age of candidate: Write a method named eligibleForSenate that returns a boolean value, and Enter years of U.S. citizenship: 25 another method named eligibleForHouse that also returns a boolean value. Both methods accept two Integer arguments (via parameters named age and The candidate is eligible for election to both the House of length OfCitizenship), and each returns the corresponding congressional Representatives and the Senate. eligibility as a boolean (not Boolean) value. Use these two eligibility methods within a Java program whose main method requests Input from the user, and then calls upon these methods In order to produce appropriate output that gets phrased as shown below. Here are 3 sample executions of your program: CONGRESS ELIGIBILITY Enter age of candidate: 37 Enter years of U.S. citizenship: 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!