Trace the code below to find the two errors.
One is a syntax error meaning the code will not run with it, the other is a runtime error, where the code will run but the output is incorrect.

subtotal = input("Enter total before tax:")

tax = .08 * subtotal

print("tax on" + subtotal + "is:" + str(tax))

Respuesta :

Syntax errors would prevent a program running at all, while runtime errors would prevent the program from running properly

How to locate the error

The subtotal variable is to take a numerical value (i.e. integer or float).

From the question, the first line gets a string value for the subtotal variable.

So, the first error in the program is:

subtotal = input("Enter total before tax:")

The second error is in printing the output on line 3.

The line 3 is an error because the line attempts to print a numerical value and a string value without converting the numerical value to string value.

So, the correct program is:

subtotal = float(input("Enter total before tax:"))

tax = .08 * subtotal

print("tax on " + str(subtotal) + " is: " + str(tax))

Read more about errors at:

https://brainly.com/question/18497347