The tax calculator program of the case study outputs a floating-point number that might show more than two digits of precision. Use the round function to modify the program to display at most two digits of precision in the output number.

Respuesta :

Answer:

Explanation:

The following code is written in Python. The tax calculator program was not provided, therefore I created a tax calculator that takes in the total price as an input and adds a 7% tax to it. Then it uses the round() function to make sure that the total is outputted as a decimal with two decimal digits at most.

def taxCalculator(price):

   total = price * 1.07

   formattedTotal = round(total, 2)

   return formattedTotal

Ver imagen sandlee09
ACCESS MORE