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

Safari F 12:28 AM Documents undo CISP 1010 Midterm IncomeTaxRevised4x 3 A CISP 1

ID: 3863387 • Letter: S

Question

Safari F 12:28 AM Documents undo CISP 1010 Midterm IncomeTaxRevised4x 3 A CISP 1010 Computer Science I Midterm Examination You are to write a C++ program to compute federal personal income taxes. Program is to have no global variables. Use the concepts we have encountered in the first seven chapters. You are not to use functions, enums, arrays, structs, classes, or pointers. The tax owned depends on how much money one makes as well as their filing status. For our purposes we will use four filing statuses. These are (i)single filers, (2)married filing jointly, G)manried filing separately, and (4)head of household. Tax Single Filers Mamied Filing Married Filing Head of Jointly Separately Household 12% Up to S7,550 Up to S15.100 Up to S7.550 Up to S100,750 16% S7,551-S30,650 S15,101-S61,300 S7, 551-S30, 650 S10.751-S41.050 20% S30,651-S74,200 S61,301-S123,700 S30,651-S61,850 S41,051-S106,000 28% S74, 201-S154,800 S123,701- $61,851-S94,225 S106, 001- S171,650 S188,450 32% s154,801- S188,451- $94,226 S 168,275 S171,651- S336,550 S336,550 S336,550 40% S336,551 or more S336 551 or more S168,276 or more S336,55l or more For each filing status there are six tax rates. Each rate is applied to a given amount of the taxable income. For example, for a taxable income of S450,000 for a single filer, S7,550 is taxed at 12%, (S30,650-S7,550) at 16%, (S74,200-S30,650) at 20% (S154,800- S74,200) at 28%, (S336,550-S154,800) at 32%, and (S450,000-336,550) at 40% for a tax amount of S139,419. Variables Name Type Description and edit specifications statusCode int Status code must be from 1 to 4. 1 single, 2 married filing jointly, 3 married filing separately, 4- head of household, 9 end processing. 73%

Explanation / Answer

Solution ::

// header files
#include <iostream.h>
#include<fstream.h>
enum status{single, married};

void getstatusdata();

double taxAmount(int, double, double, int);

int getnum_kids();

int main()

{

void getstatusdata();

return 0;

}
void getstatusdata()
{
status State;
int no_of_kids;
char answer;
double Salary;
int num_person;

double standardExemption;

double tax;

cout<<" Enter: Single or Married "<<endl;

cin>>State;

switch (State)

{

case: "married" case:"Married";

no_of_kids = getnum_kids();

cout<<"Enter Y (or) N if both of you earn income (or) not: "<<endl;

cin>>answer;

if (answer=('y'||'Y'))

{

cout<<"Enter the combined Salary of your's: "<<endl;

cin>>Salary;

}

else

{

cout<<"Enter your Salary itself: "<<endl;

cin>>Salary;

}

num_person = 2 + no_of_kids;

break;

case: "single" case:"Single";

cout<<"Enter your Salary: "<<endl;

cin>>Salary;

num_person = 1;

cout<<"Enter contribution to pension: "<<endl;

cin>>standardExemption;

tax= taxAmount(State, num_person, Salary, standardExemption);

}

int getnum_kids()

{
int kids;


cout<<"Enter number of kids under the age of 14: ";endl;

cin>>kids;

return kids;

}

//double taxAmount(int num_person, double Salary, double amountInPension, int standardExemption)
071
double taxAmount(status State, int num_person, double Salary, double pensionrate)

{

double taxable_income;

double tax;

/*double standardExemption;

taxable_income = Salary - (1500.00 * num_person) - amountInPension - standardExemption;

return(taxable_income);*/

}

switch (State)

{

case single:

taxable_income = Salary-4000-1500*num_person-(standardExemption*Salary)/100;

break;

case married:

taxable_income = Salary-7000-1500*num_person-(standardExemption*Salary)/100;

break;

}

switch (taxable_income)

{

case>0 & case is<15000

tax = .15*taxable_income;

break;

case>15001 & case is<40000

tax = 2250 + .25*(taxable_income-15000);

break;

case>0 & case is<15000

tax = 8460 + .35*(taxable_income-40000);
}
return tax;
}

/// *** Thank You *** ///