Question

Program 4: In 1789, Benjamin Franklin is known to have written “Our new Constitution is now...

Program 4: In 1789, Benjamin Franklin is known to have written “Our new Constitution is now established, and has an appearance that promises permanency; but in this world nothing can be said to be certain, except death and taxes.” Our federal tax system is a “graduated” tax system which is broken into seven segments. Essentially, the more you make, the higher your tax rate. For 2018, you can find the tax brackets here. Your task is to design (pseudocode) and implement (C++ source code) a program that asks the user for a salary and calculates the federal tax owed. Note, that only the money above a particular tax bracket gets taxed at the higher rate. For example, if someone makes $10,000 a year, the first $9525 gets taxed at 10%. The “excess” above that ($475) gets taxed at 12%.  

Sample run 1:

Enter your salary to the nearest dollar: 2000

Total tax owed is: $200

Sample run 2:

Enter your salary to the nearest dollar: 40000

Total tax owed is: $4739

Sample run 3:

Enter your salary to the nearest dollar: 100000

Total tax owed is: $18289

link for tax brackets:

https://www.hrblock.com/tax-center/irs/tax-brackets-and-rates/what-are-the-tax-brackets/

Homework Answers

Answer #1

#include <iostream>

using namespace std;


/*10% Up to $9,525

12% $9,526 to $38,700

22% $38,701 to $82,500

24% $82,501 to $157,500

32% $157,501 to $200,000

35% $200,001 to $500,000

37% over $500,000
*/

int main()
{
int salary;
double tax=0;
cout<<"Enter your salary to the nearest dollar: ";
cin>>salary;
if(salary<=9525){
tax=952;
}
//checking for 2nd slot tax

if(salary >9525 && salary<=38700){
tax=9525*0.1;
tax=(tax+(salary-9525)*0.12);
}
//checking for 3rd slot tax
  
if(salary >38700 && salary<=82500){
tax=9525*0.1;
tax=(tax+(salary-9525)*0.12);
tax=(tax+(salary-38700)*0.22);
cout<<tax<<endl;
}
//checking for 4th slot tax

if(salary >82500 && salary<=157500){
tax=9525*0.1;
tax=(tax+(salary-9525)*0.12);
tax=(tax+(salary-38700)*0.22);
tax=(tax+(salary-82500)*0.24);
}
if(salary >157500 &&salary<=200000){
tax=9525*0.1;
tax=(tax+(salary-9525)*0.12);
tax=(tax+(salary-38700)*0.22);
tax=(tax+(salary-82500)*0.24);
tax=(tax+(salary-157500)*0.32);
}
if(salary >200000 &&salary<=500000){
tax=9525*0.1;
tax=(tax+(salary-9525)*0.12);
tax=(tax+(salary-38700)*0.22);
tax=(tax+(salary-82500)*0.24);
tax=(tax+(salary-157500)*0.32);
tax=(tax+(salary-200000)*0.35);
}
if(salary>500000){
tax=9525*0.1;
tax=(tax+(salary-9525)*0.12);
tax=(tax+(salary-38700)*0.22);
tax=(tax+(salary-82500)*0.24);
tax=(tax+(salary-157500)*0.32);
tax=(tax+(salary-200000)*0.35);
tax=(tax+(salary-500000)*0.37);
}
  
  
cout<<"Total tax owed is: $"<<tax;
return 0;
}

I have used the above tax rates . Please share the correct tax rates so that you will get the correct output

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
I have solved the problem up to number 6. all my answers from 7 keeps coming...
I have solved the problem up to number 6. all my answers from 7 keeps coming up incorrect. That is where i need the help. Thank you Note: This problem is for the 2018 tax year. Daniel B. Butler and Freida C. Butler, husband and wife, file a joint return. The Butlers live at 625 Oak Street in Corbin, KY 40701. Dan's Social Security number is 111-11-1112, and Freida's is 123-45-6789. Dan was born on January 15, 1967, and Freida...
What role could the governance of ethics have played if it had been in existence in...
What role could the governance of ethics have played if it had been in existence in the organization? Assess the leadership of Enron from an ethical perspective. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among the top Fortune 500 companies, collapsed in 2001 under a mountain of debt...
Discuss how the respective organizations’ relations with stakeholders could have potentially been affected by the events...
Discuss how the respective organizations’ relations with stakeholders could have potentially been affected by the events that took place at Enron and how the situation could have been dealt with differently to prevent further damage? THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among the top Fortune 500 companies,...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...
Discuss ethical issues that can be identified in this case and the mode of managing ethics...
Discuss ethical issues that can be identified in this case and the mode of managing ethics Enron finds itself in this case. How would you describe the ethical culture and levels of trust at Enron? Provide reasons for your assessment. THE FALL OF ENRON: A STAKEHOLDER FAILURE Once upon a time, there was a gleaming headquarters office tower in Houston, with a giant tilted "£"' in front, slowly revolving in the Texas sun. The Enron Corporation, which once ranked among...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT