Home / Expert Answers / Computer Science / in-c-22-10-lab-program-income-tax-form-functions-program-specifications-write-a-program-to-ca-pa465

(Solved): In c++ 22.10 LAB*: Program: Income tax form - functions Program Specifications Write a program to ca ...



In c++

22.10 LAB*: Program: Income tax form - functions
Program Specifications Write a program to calculate U.S. income tax owed giv
22.10 LAB*: Program: Income tax form - functions Program Specifications Write a program to calculate U.S. income tax owed given wages, taxable interest, unemployment compensation, status (dependent, single, or married), and taxes withheld. Dollar amounts are displayed as integers without comma separators. For example, cout << "Deduction: $" << deduction << endl; 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. Within main() input wages, taxable interest, unemployment compensation, status (0-dependent 1-single, and 2-married), and taxes withheld as integers Step 2 (2 pts). Complete the CalcAGI() function. Calculate the adjusted gross income (AGI) that is the sum of wages, interest, and unemployment. Convert any negative values to positive before summing to correct potential input errors. Return the AGI. Note the provided code in main() calls CalcAGI() and outputs the returned value. Submit for grading to confirm two tests pass Ex: If the input is: 20000 23 500 1 400 The output is AGI: $20523 Step 3 (2 pts). Complete the GetDeduction() function. Return the deduction amount based on status: (0) dependent=6000, (1) single- 12000, or (2) married-24000. Return 6000 if the status is anything but 0, 1, or 2. Within main() call GetDeduction) and output the returned value. Submit for grading to confirm four tests pass. Ex If the input is


We have an Answer from Expert

View Expert Answer

Expert Answer


C++ Code: #include using namespace std; int CalcAGI(int w, int tax, int unemp){ int agi = 0; if(w<0) { w = -1*(w); } if(tax<0){ tax = -1*(tax); } if(unemp<0){ un
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe