Question: Jill has written a program that computes the sales tax on the purchase of an item, given the price of the item ( a floating
Jill has written a program that computes the sales tax on the purchase of an item, given the price of the item a floatingpoint number and the percent tax rate an integer The output of the program is the purchase price, the tax, and the total amount to be paid. Here is her code:
purchasePrice floatinputEnter the purchase price as $:
taxRate intinputEnter the tax rate as :
tax purchasePrice taxRate
totalOwed purchasePrice tax
printPurchase price: purchasePrice
printTax: tax
printTotal owed: totalOwed
When she tested his program with a purchase price of $ and a sales tax of Jill observed the following unexpected output:
Enter the purchase price as $:
Enter the tax rate as :
Purchase price:
Tax:
Total owed:
Determine what causes this error and fix it
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
