1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lubov Fominskaja [6]
3 years ago
7

The tax calculator program of the case study outputs a floating-point number that might show more than two digits of precision.

Computers and Technology
1 answer:
Aneli [31]3 years ago
4 0

Answer:

TAX_RATE = 0.20

STANDART_DEDUCTION = 10000.0

DEPENDENT_DEDUCTION = 3000.0

gross_income = float(input("Enter the gross income: "))

number_of_dependents = int(input("Enter the number of dependents: "))

income = gross_income - STANDART_DEDUCTION - (DEPENDENT_DEDUCTION * number_of_dependents)

tax = income * TAX_RATE

print ("The income tax is $" + str(round(tax, 2)))

Explanation:

Define the <em>constants</em>

Ask user to enter the <em>gross income</em> and <em>number of dependents</em>

Calculate the <em>income</em> using formula (income = gross_income - STANDART_DEDUCTION - (DEPENDENT_DEDUCTION * number_of_dependents))

Calculate the <em>tax</em>

Print the <em>tax</em>

<em />

round(number, number of digits) -> This is the general usage of the <em>round</em> function in Python.

Since we need <u>two digits of precision</u>, we need to modify the program as str(<u>round(incomeTax, 2</u>)).

You might be interested in
Which can be inserted using the insert panel in dreamweaver cc?
timofeeve [1]

Answer: Learn how to use the Insert panel in Dreamweaver to create and insert objects, such as tables, images, OAM files, and Bootstrap components. The Insert panel contains buttons for creating and inserting objects such as tables and images. The buttons are organized into categories.

3 0
3 years ago
___________ are the constant values that are used in a program. ​
77julia77 [94]

Answer: Data

Explanation:

3 0
3 years ago
Sandy has an entry-level position in a graphic design company. She wants to learn more about the company and the skills she shou
Yakvenalex [24]
The answer should have been B, what was the answer?
8 0
3 years ago
Read 2 more answers
Types of email resources. Examples
denis23 [38]
Newsletter emails
Milestone emails
Welcome emails
Review request emails

Hope this helps!
8 0
3 years ago
What's the component of the hardware?​
melisa1 [442]
Some component of the hardware are central processing unit (CPU), monitor, mouse, keyboard, computer data storage, graphics card, sound card, speakers and motherboard.

I’m sure theirs more but here’s so. Hope this helps!
7 0
2 years ago
Read 2 more answers
Other questions:
  • Create a program in Matlab that prints the numbers from 1-100.
    11·1 answer
  • Carol typed a memo to send to everyone in her department. To create this memo, she used a _____. spreadsheet word processor fax
    10·2 answers
  • What is the minimum number of data points you should usually have to look for signs of improvement on a run chart?
    8·1 answer
  • Insert a row above the selected row (in between row 1 and row 2).
    15·2 answers
  • Select the correct answer.
    15·1 answer
  • You can fit more RAW files on a memory card than JPEG files. true or false
    10·1 answer
  • Lucas wants to expand his vocabulary to better understand the sentence below. The insidious burglar moved through the house unhe
    7·2 answers
  • Brainly not working for me not showing any ads or answers
    5·2 answers
  • ????????????helpppp please
    9·1 answer
  • If the value of score1 is 350 and the value of score2 is 210, what will be the value of result after the code segment is execute
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!