Question: Programs solve in c++ A person is eligible to be a US Senator who is at least 30 years old and has been a US

 Programs solve in c++ A person is eligible to be aPrograms solve in c++

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. 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. Write a function called congress Eligibility that has two parameters: age and citizenship. These parameters contain information of a given user, age contains the user age and citizenship contains the length of citizenship. The function should return a string value containing one of the following three statements that is accurate: .You are eligible for both the House and Senate. You are eligible only for the House. You are ineligible for Congress. Write a main program where you will create three arrays, one for names ( length of citizenship. Store the following values in the arrays strings), one for age, and one for Names: Ann, Jen, Tim, Tom, Mike, Ben, Mon, Bob, Brad, Zoe, Ted, Karl, Kim, Jim, Rob, Max. Ages: 60, 65, 16, 22, 27, 25, 28, 66, 35, 36, 72, 71, 60, 46, 44, 50 Lengths of citizenship: 4, 15, 7,22, 5, 20, 10, 10, 2, 10, 12, 71, 60, 46, 4, 50 The values stored in these arrays correspond to names, weights, and heights of users. Your program should loop through the arrays to check the congress eligibility of each user (using the congressEligibility function) and it should display the name and result, one per line. For example, the first two lines of output of your program should be: Ann, you are ineligible for Congress Jen, you are eligible for both the House and Senate

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 Databases Questions!