program contains 5 errors. The errors will fall into one of two categories: things that cause the program to crash, or things that cause the program to produce incorrect results.  Problems that do not fall into those two categories (like formatting output) will not be considered an error. The program should calculate the total price of an item by calculating city and state taxes. Once the total tax amount is calculated and added to the item price, the program will display the total price. **My issue is the math is off and I can't figure out how to fix it so it looks like the example

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
100%

The program contains 5 errors. The errors will fall into one of two categories: things that cause the program to crash, or things that cause the program to produce incorrect results.  Problems that do not fall into those two categories (like formatting output) will not be considered an error.


The program should calculate the total price of an item by calculating city and state taxes. Once the total tax amount is calculated and added to the item price, the program will display the total price.

**My issue is the math is off and I can't figure out how to fix it so it looks like the example.** 

 

■%
itemPrice=float(input('Enter price of an item: '))
STATE_TAX_RATE= 0.6
CITY_TAX_RATE = 0.2
totalTax = itemPrice * STATE_TAX_RATE + itemPrice*CITY_TAX_RATE
totalPrice = itemPrice+totalTax
print('Item price is '+str(itemPrice)+" and total tax is "+str(totalTax))
print('Total price is '+str(totalPrice))
No issues found
tput
ow output from: Build
or List Output
▶
Ln: 11
Ch: 39
SPC
CRLF
▼ x
S
P
Transcribed Image Text:■% itemPrice=float(input('Enter price of an item: ')) STATE_TAX_RATE= 0.6 CITY_TAX_RATE = 0.2 totalTax = itemPrice * STATE_TAX_RATE + itemPrice*CITY_TAX_RATE totalPrice = itemPrice+totalTax print('Item price is '+str(itemPrice)+" and total tax is "+str(totalTax)) print('Total price is '+str(totalPrice)) No issues found tput ow output from: Build or List Output ▶ Ln: 11 Ch: 39 SPC CRLF ▼ x S P
The program should calculate the total price of an item by calculating city and state taxes. Once the total tax amount
is calculated and added to the item price, the program will display the total price.
Sample runs and output below:
Enter price: 19.50
Item price is 19.5 and total tax is 1.56
Total price is 21.06
>>>
Enter price: 15.00
Item price is 15.0 and total tax is 1.2
Total price is 16.2
<<<
Transcribed Image Text:The program should calculate the total price of an item by calculating city and state taxes. Once the total tax amount is calculated and added to the item price, the program will display the total price. Sample runs and output below: Enter price: 19.50 Item price is 19.5 and total tax is 1.56 Total price is 21.06 >>> Enter price: 15.00 Item price is 15.0 and total tax is 1.2 Total price is 16.2 <<<
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage