Question: the code; #include #include / / For rounding / / Function to calculate Adjusted Gross Income ( AGI ) int CalcAGI ( int wages, int
the code; #include
#include For rounding
Function to calculate Adjusted Gross Income AGI
int CalcAGIint wages, int interest, int unemployment
return wages interest unemployment;
Function to get deduction based on status
int GetDeductionint status
switch status
case : return ;
case : return ;
case : return ;
default:
printfError: Must input status dependentsingle or married
;
exit;
Function to calculate taxable income
int CalcTaxableint AGI, int deduction
int taxable AGI deduction;
if taxable
taxable ;
return taxable;
Function to calculate federal tax based on status and taxable income
int CalcTaxint status, int taxable
double federalTax;
if status status Dependent or single filers
if taxable
federalTax taxable ;
else if taxable
federalTax taxable ;
else if taxable
federalTax taxable ;
else
federalTax taxable ;
else if status Married filers
if taxable
federalTax taxable ;
else if taxable
federalTax taxable ;
else
federalTax taxable ;
else
printfError: Invalid status for tax calculation.
;
exit;
return int roundfederalTax;
Function to calculate tax due or refund
int CalcTaxDueint federalTax, int withheld
int taxDue federalTax withheld;
if taxDue
printfTax Owed: $d
taxDue;
else
printfTax Refund: $d
taxDue;
return taxDue;
int main
int wages, interest, unemployment, status, withheld;
Step : Input
printfPlease enter wages, taxable interest, and unemployment compensation: ;
scanfd d d &wages, &interest, &unemployment;
printfPlease enter status dependent, single, married: ;
scanfd &status;
if status && status && status
printfError: Must input status dependentsingle or married
;
return ;
printfPlease enter taxes withheld: ;
scanfd &withheld;
if withheld
printfError: taxes withheld cannot be less than
;
return ;
Step : Calculate AGI and display
int AGI CalcAGIwages interest, unemployment;
printfAGI: $d
AGI;
Step : Calculate deduction and display
int deduction GetDeductionstatus;
printfDeduction: $d
deduction;
Step : Calculate taxable income and display
int taxableIncome CalcTaxableAGI deduction;
printfTaxable Income: $d
taxableIncome;
Step : Calculate federal tax and display
int federalTax CalcTaxstatus taxableIncome;
printfFederal Tax: $d
federalTax;
Step : Calculate tax due or refund and display
int taxDueOrRefund CalcTaxDuefederalTax withheld;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
