Input values • Enter the wages: 80000 • Entrer the taxable interest: 0 • Enter unemplyment compensation : 500 • Enter status (dependent, single, or married ):married Enter withheld amount :12000 Expected output Gross income: $80,500 Deduction : $24,000 Taxable income: $56,500 Federal tax: $6,380 Tax due: $-5,620

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

practice python part 3

Input values
• Enter the wages: 80000
• Entrer the taxable interest: 0
• Enter unemplyment compensation : 500
Enter status (dependent, single, or married ):married
• Enter withheld amount :12000
Expected output
Gross income: $80,500
Deduction : $24,000
Taxable income: $56,500
Federal tax: $6,380
Tax due: $-5,620
Transcribed Image Text:Input values • Enter the wages: 80000 • Entrer the taxable interest: 0 • Enter unemplyment compensation : 500 Enter status (dependent, single, or married ):married • Enter withheld amount :12000 Expected output Gross income: $80,500 Deduction : $24,000 Taxable income: $56,500 Federal tax: $6,380 Tax due: $-5,620
Practice Python Part 3
**P3: Write a program to calculate 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.
create tax_module using following functons
• def calc_gross_income(wages, interest, unemployment)
• Calculate the calc_gross_income() that is the sum of wages, interest, and unemployment. Convert any negative values to positive before summing to
correct potential input errors. Return the gross income
• def get_deduction(status)
• Complete the get_deduction() function. Return the deduction amount based on status: dependent = 6000, single = 12000, or married-24000. Return
deduction
• def calc_taxable(gross_income, deduction)
Complete the calc_taxable() function. Calculate taxable amount (gross/-income - deduction). Set taxable to zero if calculation results in negative valu
Return taxable_value
def calc_tax(status, taxable)
• 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()
• def calc_tax_due(tax, withheld)
. 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)
main program import the module tax_module.py
• Within the main portion of the code, input the wages, taxable interest, unemployment compensation, status (dependent,single, and married), and
taxes withheld.
Income
$0-$10,000
$10,001 - $40,000
$40,001 - $85,000
over $85,000
Income
$0-$20,000
$20,001 - $80,000
over $80,000
Tax for Dependent or Single Filers
10% of the income
$1,000+ 12% of the amount over $10,000
$4,600 +22% of the amount over $40,000
$14,500 + 24% of the amount over $85,000
Tax for Married Filers
10% of the income
$2,000+12% of the amount over
$20,000
$9,200 + 22% of the amount over $80,000
Transcribed Image Text:Practice Python Part 3 **P3: Write a program to calculate 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. create tax_module using following functons • def calc_gross_income(wages, interest, unemployment) • Calculate the calc_gross_income() that is the sum of wages, interest, and unemployment. Convert any negative values to positive before summing to correct potential input errors. Return the gross income • def get_deduction(status) • Complete the get_deduction() function. Return the deduction amount based on status: dependent = 6000, single = 12000, or married-24000. Return deduction • def calc_taxable(gross_income, deduction) Complete the calc_taxable() function. Calculate taxable amount (gross/-income - deduction). Set taxable to zero if calculation results in negative valu Return taxable_value def calc_tax(status, taxable) • 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() • def calc_tax_due(tax, withheld) . 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) main program import the module tax_module.py • Within the main portion of the code, input the wages, taxable interest, unemployment compensation, status (dependent,single, and married), and taxes withheld. Income $0-$10,000 $10,001 - $40,000 $40,001 - $85,000 over $85,000 Income $0-$20,000 $20,001 - $80,000 over $80,000 Tax for Dependent or Single Filers 10% of the income $1,000+ 12% of the amount over $10,000 $4,600 +22% of the amount over $40,000 $14,500 + 24% of the amount over $85,000 Tax for Married Filers 10% of the income $2,000+12% of the amount over $20,000 $9,200 + 22% of the amount over $80,000
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Payback period
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning