Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code given is: /** * This program computes income taxes based on adjusted * gross income and a child tax credit. * */ #include

image text in transcribed

The code given is:

/** * This program computes income taxes based on adjusted * gross income and a child tax credit. * */ #include  #include  int main(int argc, char **argv) { double agi = 0.0; char c = 'N'; double tax = 0.0; double childCredit = 0.0; double totalTax = 0.0; int numChildren = 0; printf("Please enter your adjusted gross income (AGI): "); scanf("%lf", &agi); //remove the "enter" endline character getchar(); printf("Do you have any children? (Y) or (N)? "); c = getchar(); if(c == 'y' || c == 'Y') { printf("How many children do you have? "); scanf("%d", &numChildren); } //TODO: compute the tax, child credit, and total tax here printf("AGI: $%10.2f ", agi); printf("Tax: $%10.2f ", tax); printf("Child Credit: $%10.2f ", childCredit); printf("Total Tax: $%10.2f ", totalTax); return 0; }
The federal income tax for a married couple filing jointly for 2021 is determined by the rules indicated in the following table. In addition, the total tax is reduced by $2,000 for each child that a couple has but cannot make the tax liability less than zero (for the purposes of this exercise). We have provided a partially completed program that reads in a user's Adjusted Gross Income (AGI) and prompts whether or not they have any children. If they do it prompts them for how many. Complete the program by computing the user's total tax based on the user's AGI the number of children they have. Some example input/output results can be found in the following table. For example, if the user has an adjusted gross income of $150,000 and has 4 children, then their tax would be calculated as follows. - Their AGI falls in the 3rd tax bracket and so would be $9,328+22% of the amount over $81,050 or $9,328+22%($150,000$81,050)=$24,497.00 - With 4 children, they have a $8,000 tax credit giving a new total of $16,497.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions