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

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!