Question: Write a C + + program that calculates the tax owed based on a user's income. The program should define and use functions to determine

Write a C++ program that calculates the tax owed based on a user's
income. The program should define and use functions to determine the tax bracket and
calculate the tax accordingly.
Requirements:
Function Definitions:
double calculateTax(double income): This function takes the user's income as input and
returns the amount of tax owed based on the following tax brackets:
Income up to $9,875: 10% tax
Income from $9,876 to $40,125: 12% tax
Income from $40,126 to $85,525: 22% tax
Income from $85,526 to $163,300: 24% tax
Income from $163,301 to $207,350: 32% tax
Income from $207,351 to $518,400: 35% tax
Income over $518,400: 37% tax
void displayTax(double income, double taxAmount): This function displays the income and
the calculated tax amount in a formatted manner.
Main Program:
The program should prompt the user to enter their income.
It should then call the calculateTax function to determine the tax owed.
Finally, it should use the displayTax function to output the income and tax amount.
Example Output:
Enter your annual income: 400,000
For an income of $400,000, the calculated tax is $ 114,795.00

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