Write a program in ( C++ ) that will calculate income tax. You will need as inpu
ID: 3722143 • Letter: W
Question
Write a program in (C++ ) that will calculate income tax. You will need as input the person’s annual salary. Display a message that says: This year you paid $_______ dollars in tax. So your net salary after taxes are taken out is $________.
Format your output to two decimal places.
Modify your program to also factor in state and local taxes, and deductions.
You should assume that state and local taxes (a combined 15%) only have to be paid by individuals who earn more than $38,000.
Additionally, ask the user if they have any children or if they make any student loan payments. If they do have children, ask them how many, and calculate their new tax amount factoring in a 5% deduction per child off their pre-tax annual salary.
If they do make student loan payments, ask them how much interest they paid on the loan last year, and calculate their new tax amount by subtracting the student loan interest from their pre- tax annual salary.
Salary Under $12,000 $12,001-$38,000 38,001- 55,000 Over $55,000 Tax Rate 5% 27% 33% 39%Explanation / Answer
int main(void)
{
int salary,responce,c,tax,amount,interest;
cout<<''your anual salary";
cin>>salary;
if(salary<=38000)
cout<<"This year you paid $0 dollars in tax. So your net salary after taxes are taken out is $___"<<salary;
else
{
cout<<"you have any children-yes=1or no=0 or have education loan=2";
cin>>responce;
if(responce==0)
{
tax=(15/100)*salary;
cout<<"This year you paid $"<<tax<<"dollars in tax. So your net salary after taxes are taken out is $___"<<salary-tax;
}
if(responce==1)
{
cout<<"how many children you have";
cin>>c;
amount=salary-((c*5/100)*salary);
tax=(15/100)*amount;
cout<<"This year you paid $"<<tax<<"dollars in tax. So your net salary after taxes are taken out is $___"<<salary-tax;
}
if(responce==2)
{
cout<<"how much interest you paid on the loan last year";
cin>>interest;
amount=salary-interest;
tax=(15/100)*amount;
cout<<"This year you paid $"<<tax<<"dollars in tax. So your net salary after taxes are taken out is $___"<<salary-tax;
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.