Question

Language C++ Write a program that can be used to calculate the federal tax. The tax...

Language C++

Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. The tax rates are as follows: If the taxable income is:

Between $0 and $15,000, the tax rate is 15%.

Between $15,001 and $40,000, the tax is $2,250 plus 25% of the taxable income over $15,000.

Over $40,000, the tax is $8,460 plus 35% of the taxable income over $40,000.

Prompt the user to enter the following information:

Marital status

If the marital status is “married,” ask for the number of children under the age of 14

Gross salary (If the marital status is “married” and both spouses have income, enter the combined salary.)

Percentage of gross income contributed to a pension fund Your program must consist of at least the following functions:

Function getData: This function asks the user to enter the relevant data.

Function taxAmount: This function computes and returns the tax owed.

To calculate the taxable income, subtract the sum of the standard exemption, the amount contributed to a pension plan, and the personal exemption, which is $1,500 per person. (Note that if a married couple has two children under the age of 14, then the personal exemption is $1,500 ∗ 4 = $6,000.)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

code:

#include <iostream>

#include<string.h>

using namespace std;

double salarr;

char stats[100];

char stator[100]="married";

int numofchid;

//function to get data

void getdata ()

{

cout<<"Enter marrital status";

cin>>stats;

if(strcmp(stats,stator)==0)

{

cout<<"Enter number of age below 14 children ";

cin>>numofchid;

}

cout<<"Enter total salary";

cin>>salarr;

}

//function to calculate tax

double taxAmount()

{

double stdexp=4000;

double stdexpmarrd=7000;

double penson=salarr*0.06;

double personalexp=1500;

double taxval;

if(strcmp(stats,stator)==0)

{

personalexp=personalexp*(2+numofchid);

stdexp=stdexpmarrd;

}

//calculating taxable income

double taxincom=salarr-(stdexp+penson+personalexp);

//calculating tax

if( taxincom>0 && taxincom<=15000)

{

taxval=taxincom*0.15;

}

else if( taxincom>15000 && taxincom<=40000)

{

taxval=2250+(taxincom*0.25);

}

else

{

taxval=8460+(taxincom*0.35);

}

return taxval;

}

int main ()

{

getdata();

double taxvalnw=taxAmount();

cout<< "Tax value is: "<<taxvalnw;

system("pause");

return 0;

}

output:

Add a comment
Know the answer?
Add Answer to:
Language C++ Write a program that can be used to calculate the federal tax. The tax...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I HAVE TO SOLVE A C++ PROGRAM, THIS ARE THE INSTRUCTIONS: Write a program that can...

    I HAVE TO SOLVE A C++ PROGRAM, THIS ARE THE INSTRUCTIONS: Write a program that can be used to calculate the federal tax. The tax is calculated as follows: For single people, the standard exemption is $4,000; for married people, the standard exemption is $7,000. A person can also put up to 6% of his or her gross income in a pension plan. The tax rates are as follows: If the taxable income is: Between $0 and $15,000, the tax...

  • Please write in MATLAB code Write a program that can calculate the amount of federal tax...

    Please write in MATLAB code Write a program that can calculate the amount of federal tax a person owes for the upcoming year. After calculating the amount of tax owed, you should report to the user their filing status (single/joint), which tax rate they fell under, as well as the tax owed. Example: “As a single filer you fell under 12% tax bracket and you owe $3500.” Disclaimer: This example is simplified and is not intended to be an accurate...

  • Linette, a single taxpayer, had the tollowing income and deductions tor the tax year 2018: C...

    Linette, a single taxpayer, had the tollowing income and deductions tor the tax year 2018: C ck the icon to view the income and deductions. Click the icon to v ew the standard deduction amounts 을 (Cick the con to ew the 2018 tax rate schedule or he Single ng status. Read the requirements Requirement a. Compute Linette's taxable income and federal tax liability for 2018. First calculate the gross income, then calculate taxable income and the federal tax liability....

  • Calculate the 2017 total tax for Gordon Geist, a single taxpayer without dependents and no itemized deductions. He has active income of $43,000, a short-term capital gain income of $4,400 from the sa...

    Calculate the 2017 total tax for Gordon Geist, a single taxpayer without dependents and no itemized deductions. He has active income of $43,000, a short-term capital gain income of $4,400 from the sale of stock, and S6,400 from book royalties. What is Gordon's average tax rate? Gordon's total gross income for the 2017 tax year is (Round to the nearest cent) Assuming Gordon's filing status is single, his standard deduction for the 2017 tax year is (Enter the amount to...

  •    The program should calculate and display the amount of federal withholding tax (FWT)...

       The program should calculate and display the amount of federal withholding tax (FWT) to deduct from the weekly gross pay. a.   The amount of FWT is based on the employee’s weekly taxable wages and filing status, which is either single (including head of household) or married. The program will need to calculate the weekly taxable wages by first multiplying the number of withholding allowances by $76.90 (the value of a withholding allowance in 2015) and then subtracting the result from...

  • 2. Harriet and Harry are married and have a total gross income of $65,000. Their allowable...

    2. Harriet and Harry are married and have a total gross income of $65,000. Their allowable deductions or adjusted gross income total $1,500, and they have $4,400 of allowable itemized deductions What are Harriet and Harry's taxable income and income tax liability? Table 1. Tax Brackets and Rates, 2019 Rate For Unmarried Individuals, Taxable Income Over For Married Individuals Filing Joint Returns, Taxable income Over For Heads of Households, Taxable Income Over 10% Se $0 12% $9,700 $19,400 $13,850 $78,950...

  • Loriann, a single taxpayer, had the following income and deductions for the tax year 2018: ick...

    Loriann, a single taxpayer, had the following income and deductions for the tax year 2018: ick he icon to view he income and deductions Click the con towe w the standard deduction amounts ick the con to view the 2018 tax rate schedule for the Single ling status Read the requirements Requirement a. Compute Loriann's taxable income and federal tax liabilty for 2018 First calculate the gross income, then calculale taxable income and the federal tax iability. (Calculate the tax...

  • 2017 Income Tax Brackets Single Taxable Income Tax Rate $0 - $9,325 10% $9,326 - $37,950...

    2017 Income Tax Brackets Single Taxable Income Tax Rate $0 - $9,325 10% $9,326 - $37,950 $932.50 plus 15% of the amount over $9,325 $37,951 - $91,900 $5,226.25 plus 25% of the amount over $37,950 $91,901 - $191,650 $18,713.75 plus 28% of the amount over $91,900 $191,651 - $416,700 $46,643.75 plus 33% of the amount over $191,650 $416,701 - $418,400 $120,910.25 plus 35% of the amount over $416,700 $418,401 or more $121,505.25 plus 39.6% of the amount over $418,400 Married...

  • Linette, a single taxpayer, had the following income and deductions for the tax year 2018 EEB...

    Linette, a single taxpayer, had the following income and deductions for the tax year 2018 EEB (Click the icon to view the income and deductions.)(Click the icon to view the standard deduction amounts.) (Click the icon to view the 2018 tax rate schedule for the Single filing status.) Read the requirements Requirement a. Compute Linette's taxable income and federal tax liability for 2018 First calculate the gross income, then calculate taxable income and the federal tax lability. (Calculate the tax...

  • Uppose an unmarried individual without children has $40,000 in labor earnings. She has no other i...

    uppose an unmarried individual without children has $40,000 in labor earnings. She has no other income. Use the standard deduction and assume that aside from the Child Tax Credit and the EITC, no other tax credits exist. Use the tax tables from the handout to answer the following: a. How much is the employee portion of FICA that was withheld from the person's paychecks? b. What is the governments total tax revenue from payroll taxes from this person? c. What...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT