Question: I would like to fix my code (below). When I run it I would like to be able to select one of three choices, however

I would like to fix my code (below).

When I run it I would like to be able to select one of three choices, however it goes directly into the "pay calculation". Can someone help me with this? Also, I cannot seem to get the pay calculator to print each ref on the same line. Thank you in advance!

# Pay Calculation

answer=input("Would you like to calculate another pay, mpg, or quit? (pay, mpg, or quit)")

answer="pay" while answer =="pay":

name=input("What is the employee name? ")

hourlyPay=input("What is the employee hourly wage in $USD? ") hoursWorked=input("How many hours were worked this week? ") weeklyPay=(float(hourlyPay)*float(hoursWorked)) roundedPay=round(weeklyPay, 2) currency="${:,.2f}".format(roundedPay) print(name) print("should be paid ") print(currency)

answer=input("Would you like to calculate another pay, mpg, or quit? (pay, mpg, or quit)")

# MPG Calculation

answer="mpg" while answer =="mpg":

distDriven=input("What is the total distance driven? ") fuelUsed=input("How many gallons of gas was purchased? ") totalMpg=(float(distDriven)/float(fuelUsed)) roundedMpg=round(totalMpg, 2) print("The miles per gallon is: ") print(roundedMpg)

answer=input("Would you like to calculate another pay, mpg, or quit? (pay, mpg, or quit)")

answer="quit" while answer =="quit":

print("Thank you for using this ultra-advanced program!")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!