Question: # defining function water_bill() def water_bill(): # taking inputs customer_type = input(Enter the customer's code: ) #expert modification while customer_type != i: print(Invalid entry try
# defining function water_bill() def water_bill(): # taking inputs customer_type = input("Enter the customer's code: ") #expert modification while customer_type != "i": print("Invalid entry try again, please enter") customer_type = input("Enter the customer's code: ") #Expert Modification flag = False while not(flag): try: start_reading = int(input("Enter the customer's beginning meter reading: ")) flag = True except ValueError: print("This is not a number, try again: ") #expert modification flag = False while not(flag): try: end_reading = int(input("The customer's ending meter reading: ")) flag = True except ValueError: print("This is not a number, try again: ") # printing input values print(" Customer code: " + customer_type) print("Beginning meter reading: {:0>9}".format(start_reading)) print("Ending meter reading: {:0>9}".format(end_reading)) calculation = True while calculation: # variable to store gallons used gallon_used = 0.0 # error check for meter reading if (0 
The code fails on the beginning meter reading test. when my input is -1 it should display "invalid entry" can you please fix that.
CSULB CECS174 Project 3 Objectives: This assignment focuses on using while loop to get valid entries and to ask the use if they want to run the code again. Modify project 2 to use the while loop to get a valid entry from the user. Then towards the end ask the user if s/he wants to run again. Accepty or n using any combination (upper or lower). Use the same test cases, however if the user enters an invalid entry output an error message and ask the user to try again Example Sample Output Red-input, Blue output Customer code: t Invalid Entry try again, please enter Customer code: Invalid Entry try again, please enter Customer code: i Beginning meter reading: -1 Invalid Entry try again, please enter Beginning meter reading: 999999997 Ending meter reading: 000000005 Do the same for every user's entry. Don't move to the next entry until you get the valid one. Then towards the end and after showing the output, ask the user if they want to perform calculation again (accept y or n only) If the user choses Y, run the code again until the user chooses n. Print Goodbye and exit. Be creative, use a while loop and selection statements. Don't use anything that we did not learn yet. That is a short project. It is due Saturday 3/6 midnight Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
