Page 1 of 1

3.21 LAB*: Program: Income tax form Program Specifications Write a program to calculate U.S. income tax owed given wages

Posted: Thu Jul 14, 2022 2:12 pm
by answerhappygod
3 21 Lab Program Income Tax Form Program Specifications Write A Program To Calculate U S Income Tax Owed Given Wages 1
3 21 Lab Program Income Tax Form Program Specifications Write A Program To Calculate U S Income Tax Owed Given Wages 1 (30.05 KiB) Viewed 31 times
3.21 LAB*: Program: Income tax form Program Specifications Write a program to calculate U.S. income tax owed given wages, taxable interest, unemployment compensation, status (single or married) and taxes withheld. Taxpayers are only allowed to use this short form if adjusted gross income (AGl) is less than $120000. Dollar amounts are displayed as integers with no comma separators. For example, cout «< "Deduction: \( \$ " \ll \)quot;≪ deduction Note: this program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress. Step 1 (2 pts). Input wages, taxable interest, unemployment compensation, status (1= ingle and 2= married) and taxes withheld as integers. Calculate and output AGl (wages + interest + unemployment). Output error message if AGl is above $120000 and the program stops with no additional output. Submit for grading to confirm two tests pass. Ex: If the inputis:
Step 2 (3 pts). Identify deduction amount based on status: (1) Single= $12000 or (2) Married=\$24000. Set status to 1 if not input as 1 or 2 . Calculate taxable income (AGI - deduction). Set taxable income to zero if negative. Output deduction and taxable income. Submit for grading to confirm five tests pass. Ex: If the input is: 20000235001400​ Ex: The additional output is: AGI: $20523 Deduction: $12000 Taxable income: $8523 Step 3 ( 3 pts). Calculate tax amount based on exemption and taxable income (see tables below). Tax amount should be stored as a double and rounded to the nearest whole number using round0. Submit for grading to confirm eight tests pass. Ex: If the input is: 20000235001400 Ex: The additional output is: AGI: $20523 Deduction: $12000 Taxable income: $8523 Federal Tax: $852
Step 4 (2 pts). Calculate amount of tax due (tax - withheld). If the amount due is negative the tax payer receives a refund. Output tax due or tax refund as positive values. Submit for grading to confirm all tests pass. Ex: If the input is: 800000500212000 Ex: The additional output is: AGI : $80500 Deduction: $24000 Taxable income: $56500 Federal tax: $6380 Tax refund: $5620