Question
Write function prototype and function definition. For 2021, the total contributions you make each year to all of your traditional IRAs and Roth IRAs can't
Write function prototype and function definition.
For 2021, the total contributions you make each year to all of your traditional IRAs and Roth IRAs can't be more than: $6,000 ($7,000 if you're age 50 or older) if you meet the income criteris, where if single you have to make less than $125,000 and if married you have to make less than $198,000. Write a function names calculate_ira that takes the following parameters:
1. income-integer
2. age-integer
3. isSingle-boolean variable-true if single and false is married
The function calculates and returns the total IRA contribution (as an integer value) allowed based on the rules defined above. If the user is not legible to make a contribution it would return 0. Below are a few scenarios to demonstrate how the calculation would work:
Single, makes $120,000, and is 43 years old-IRA contribution is $6,000
Married, makes $190,000, and is 50 years old-IRS contribution is $7,000
Single, makes $150,000, and is 33 years old-IRA contribution is $0
PLEASE ANSWER FOR GOOD REVIEW!
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