Welcome to Westonci.ca, the place where your questions find answers from a community of knowledgeable experts. Join our platform to connect with experts ready to provide precise answers to your questions in various areas. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform.

18.5 Project 5: 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 with comma separators. For example, print(f"Deduction: ${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. Within the main portion of the code, input the wages, taxable interest, unemployment compensation, status (O=dependent, 1=single, and 2=married), and taxes withheld. Step 2 (2 pts). Complete the calc_AGIO 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 the main portion of the code calls calc_AGIO 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: $20,523 Step 3 (2 pts). Complete the get_deduction function. Return the deduction amount based on status: O dependent = 6000, (1) single = 12000, or (2) married=24000. Return 6000 if the status is anything but 0, 1, or 2. Within the main portion of the code call get_deduction and output the returned value. Submit for grading to confirm four tests pass. Ex: If the input is: 20000 23 500 1 400 The additional output is: AGI: $20,523 Deduction: $12,000 Step 4 (2 pts). Complete the get_taxable() function. Calculate taxable amount (AGI - deduction). Set taxable to zero if calculation results in negative value. Return taxable value. Within the main portion of the code call get_taxable() and output the returned value. Submit for grading to confirm six tests pass. Ex: If the input is: 20000 23 500 1 400 The additional output is: AGI: $20,523 Deduction: $12,000 Taxable income: $8,523 Step 5 (2 pts). Complete the calc_tax() function. Calculate tax amount based on status and taxable income (see tables below). Tax amount should be stored initially as a double then rounded to the nearest whole number using round. Within the main portion of the code call calc_tax() and output the returned value. Submit for grading to confirm eight tests pass. Ex: If the input is: 50000 0 0 2 5000 The additional output is AGI: $50,000 Deduction: $24,000 Taxable income: $26,000 Federal tax: $2,720 Income Tax for Dependent or Single Filers $0 - $10,000 10% of the income $10,001 - $40,000 $1,000+ 12% of the amount over $10,000 $40,001 - $85,000 $4,600 + 22% of the amount over $40,000 over $85,000 $14,500 + 24% of the amount over $85,000 Income Tax for Married Filers $0-$20,000 10% of the income $20,001 - $80,000 $2,000 + 12% of the amount over $20,000 over $80,000 $9,200 + 22% of the amount over $80,000 Step 6 (2 pts). Complete the calc_tax_due() function. Set withheld parameter to zero if negative to correct potential input error. Calculate and return amount of tax due (tax - withheld). Within the main portion of the code call calc_tax_due() and output returned value. Submit for grading to confirm all tests pass. Ex: If the input is: 80000 0 500 2 12000 The additional output is: AGI: $80, 500 Deduction: $24,000 Taxable income: $56,500 Federal tax: $6,380 Tax due: $-5, 620 main.py Load default template... 1 # Calculate AGI and repair any negative values 2 def calc_AGI(wages, interest, unemployment): 3 return -1 4 5 # Calculate deduction depending on single, dependent or married 6 def get_deduction (status): 7 return -1 8 9 # Calculate taxable but not allow negative results 10 def calc_taxable (agi, deduction): 11 return -1 12 13 # Calculate tax for single or dependent 14 def calc_tax(status, taxable): 15 return -1 16 =a 16 17 # Calculate tax due and check for negative withheld 18 def calc_tax_due (tax, withheld): 19 return -1 2e 21 if name __main__': 22 # Step #1: Input wages, interest, unemployment, status, withheld 23 24 # Step $2: Calculate AGI 25 agi = calc_AGI (wages, interest, unemployment) 26 print("AGI: ${agi:,}") 27