Question
A person is eligible to be a US senator if they are at least 30 years old and have been a US citizen for at
A person is eligible to be a US senator if they are at least 30 years old and have been a US citizen for at least 9 years. And a person is eligible to be a US representative if these numbers are 25 and 7.
1. Create a flowchart using Raptor and
2. Write Python code that accept a person's age and year of citizenship as input and output their eligibility for the Senate and House.
Test both the flowchart as well as the program. Make sure that it prompts for the input , computes the profit, and displays the result as specified. Debug your code as necessary until it complies with all requirements.
The Raptor flowchart and Python code should prompt for user input and display results as given in the sample interactions below.
2.1 Sample Interaction
Enter age: 35 For how long has this person been a US citizen? 9 Age 35 years since becoming US citizen 9 The person is eligible to be a senator and a house representative
Enter age: 25 For how long has this person been a US citizen? 7 Age 25 years since becoming US citizen 7 The person is eligible to be a house representative
Enter age: 35 For how long has this person been a US citizen? 6 Age 35 years since becoming US citizen 6 Eligible to be neither a senator nor a house representative
To read the numbers separated by commas, use the eval function on the string returned by input. For example,
1
a, b = eval(input("Enter two numbers separated by a comma: "))
will allow the use to enter two numbers separated by a comma and have these stored in a and b.
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