Question: Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is

 Write a program that can be used to calculate the federal

Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is exist4,000: for married people, the standard exemption is exist7,000. A person can also put up to 6% of his or her gross income in a pension plan. The tax rates are as follows: if the taxable income is: Between exist0 and exist15,000, the tax rate is 15% Between exist15,001 and exist40,000, the tax is exist2, 250 plus 25% of the taxable income Over exist40,000, the tax is exist8, 460 plus 35%. of the taxable income Prompt the user to enter the following information: Marital status, road in as a character, if the user does not enter an upper or lower case 's' or 'm' re-prompt the user Number of dependents, if the user enters a value below 0 or something that cannot be interpreted as a valid integer, re-prompt the user Gross salary (if married and both spouses have income, enter the combined salary), if value is negative or cannot be interpreted as a valid decimal value, re-prompt the user Percentage of gross income contributed to a pension fund, if the value is negative, a number larger than 6% (the max percent a person can put into pension), or if the number cannot be interpreted as a valid number, re-prompt the user To calculate the taxable income, subtract the sum of the standard exemption (from the gross income), subtract the amount contributed to a pension plan, and subtract the personal exemption which is exist1, 500 per person. (Note that if a married couple has two children, then the personal exemption is exist1, 500 times 4 = exist6,000). If the taxable income becomes negative after subtracting all the deductions, then the taxable income will be 0. For this assignment, you will need to create two functions void getData(char& status, int& dependants, double& salary, doubled pension)- this function will prompt and get all the user info and will assign these values into the reference parameters double getTaxAmount(char status, int dependants, double salary, double pension) - this function will return the amount of tax they owe, using the parameters given to the function As always, comment all your variables and named constants, properly document your functions, and output your numbers to two decimal places

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!