Question: Your Tasks For this exercise, write a program that contains an introductory docstring. This documentation should describe what the program will do ( analysis )

Your Tasks
For this exercise, write a program that contains an introductory docstring. This documentation should describe what the program will do (analysis) and how it will do it (design the program in the form of a pseudocode algorithm). Include suitable prompts for all inputs, and label all outputs appropriately. After you have coded a program, be sure to test it with a reasonable set of legitimate inputs.
Instructions
The tax calculator program of the case study outputs a floating-point number that might show more than two digits of precision. Program: taxform.py
Author: Ken Lambert
Compute a person's income tax.
1. Significant constants
tax rate
standard deduction
deduction per dependent
2. The inputs are
gross income
number of dependents
3. Computations:
taxable income = gross income - the standard deduction -
a deduction for each dependent
income tax = is a fixed percentage of the taxable income
4. The outputs are
the income tax
"""
# Initialize the constants
TAX_RATE =0.20
STANDARD_DEDUCTION =10000.0
DEPENDENT_DEDUCTION =3000.0
# Request the inputs
grossIncome = float(input("Enter the gross income: "))
numDependents = int(input("Enter the number of dependents: "))
# Compute the income tax
taxableIncome = grossIncome - STANDARD_DEDUCTION -\
DEPENDENT_DEDUCTION * numDependents
incomeTax = taxableIncome * TAX_RATE
# Display the income tax
print("The income tax is $"+ str(incomeTax))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!