Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

create a program in c++ that will take the user\'s gross income and calculate th

ID: 640159 • Letter: C

Question

create a program in c++ that will take the user's gross income and calculate their total income tax. begin by listing the tax schedules and asking which schedule the user files under. then ask for the users gross income. calculate and print to the screen which tax bracket they fall under and their total income tax. the output should be formatted so that the tax rate always shows two decimal places. if the user fails to enter correct input, the program should inform the user and close. use the 2014 tax bracket.

Explanation / Answer

#include <iostream>

using namespace std;

enum status{single, married};
void getStatusData();
double taxAmount(int, double, double, int);
int getNumKids();

int main()
{
void getStatusData();

return 0;
}
void getStatusData()
{
status state;
int noOfKids;
char answer;
double salary;
int numPerson;
double standardExemption;
double tax;

cout<<"Please enter: Single or Married "<<endl;
cin>>state;

switch (state)
{
case: "married" case:"Married";

noOfKids = getNumKids();

cout<<"Please enter Y or N if both of you earn income or not: "<<endl;
cin>>answer;

if (answer=('Y'||'y'))
{
cout<<"Please enter your combined salary: "<<endl;
cin>>salary;
}
else
{
cout<<"please enter your salary: "<<endl;
cin>>salary;
}
numPerson = 2 + noOfkids;
break;

case: "single" case:"Single";

cout<<"please enter your salary: "<<endl;
cin>>salary;
numPerson = 1;

cout<<"please enter your contribution to pension: "<<endl;
cin>>standardExemption;

tax= taxAmount(state, numPerson, salary, standardExemption);
}
int getNumKids()
{
int kids;

cout<<"Pleae enter number of kids under the age of 14: ";endl;
cin>>kids;
return kids;
}
//double taxAmount(int numPerson, double salary, double amountInPension, int standardExemption)
double taxAmount(status state, int numPerson, double salary, double pensionrate)
{
double taxableincome;
double tax;
/*double standardExemption;

taxableIncome = salary - (1500.00 * numPerson) - amountInPension - standardExemption;
return(taxableIncome);*/
}

switch (state)
{
case single:
taxableincome = salary-4000-1500*numPerson-(standardExemption*salary)/100;
break;
case married:
taxableincome = salary-7000-1500*numPerson-(standardExemption*salary)/100;
break;

}

switch (taxableincome)
{
case>0 & case is<15000
tax = .15*taxableincome;
break;
case>15001 & case is<40000
tax = 2250 + .25*(taxableincome-15000);
break;
case>0 & case is<15000
tax = 8460 + .35*(taxableincome-40000);
}

return tax; ?