Concept explainers
PLEASE ANSWER USING C++
Step 1 . Input wages, taxable interest, unemployment compensation, status (1=single and 2=married), and taxes withheld as integers. Calculate and output AGI (wages + interest + unemployment). Output error message if AGI is above $120000 and the program stops with no additional output. Submit for grading to confirm two tests pass.
Ex: If the input is:
20000 23 500 1 400
The output is:
AGI: $20523
Ex: If the input is:
120000 23 500 1 400
The output is:
AGI: $120523
Error: Income too high to use this form
Step 2. 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:
20000 23 500 1 400
Ex: The additional output is:
AGI: $20523
Deduction: $12000
Taxable income: $8523
Step 3. Calculate tax amount based on exemption and taxable income (see tables below). The tax amount should be stored as a double and rounded to the nearest whole number using round(). Submit for grading to confirm eight tests pass.
Ex: If the input is:
20000 23 500 1 400
Ex: The additional output is:
AGI: $20523
Deduction: $12000
Taxable income: $8523 Federal tax: $852
Step 4. Calculate the amount of tax due (tax - withheld). If the amount due is negative the taxpayer 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:
80000 0 500 2 12000
Ex: The additional output is:
AGI: $80500
Deduction: $24000
Taxable income: $56500
Federal tax: $6380
Tax refund: $5620
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images
Using the follow-up answer provided I am getting more errors than before. Can you please fix the errors? Thank you.
This problem has now cost me 3 questions.
USING C++ can you please fix according to the errors received using your code? Thank you.
Using the follow-up answer provided I am getting more errors than before. Can you please fix the errors? Thank you.
This problem has now cost me 3 questions.
USING C++ can you please fix according to the errors received using your code? Thank you.
- B- Assume (n, d, m, f, k, e) are variables with integer data type in which n=1, d=m=f=2, e=9. Calculate the value of d, n, k and m for the following statement. Du d++ + --n+(k=e/2);arrow_forwardLogical variables: On Time or Delayed? Complete the function WhatlsIt such that: The output logical variable on Time is true only if no Traffic is true and gasEmpty is false. The output logical variable delayed is false only if no Traffic is true and gasEmpty is false. Restriction: Logical expressions must be used. Do not use if statements. Function > 1 function [onTime, delayed] = WhatIsIt (noTraffic, gasEmpty) 2 onTime = 3 delayed = 4 5 end Save C Reset MATLAB Documentationarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education