Question: Question 16 6 pts Analyze the Python code written below. There are 3 errors. In the space below identify the line that contains the error,

Question 16 6 pts Analyze the Python code written below. There are 3 errors. In the space below identify the line that contains the error, the type of error and how to fix it. If you would like to copy and paste the code into IDLE you can. However, if you simply upload fixed code, you will not receive any credit for this question. In order to receive credit for this question you need to identify the line where the error occurs, the type of error and how you would fix it. When running correctly this code is supposed to ask the user for the name of their dog, their purchase options and the number of days, nights or sessions they wish to purchase. The program will then calculate the total cost and print out the name of the dog and the total. If the user enters D when prompted for their choice of options, Spot for the name of their dog and 3 for the number of days, the prbgram will print the following: Dog Name: Total is: Spot $ 60 Your grade will be based on the following: . What is causing the bug = 0,5 points o What kind of bug is it? (logical, syntax, run-time) - 0.5 points How would you fix this bug? - 1 points UserChoice - stro numitems - int CostPerDay Day Care - 20 35 JUS Vad, s, fi V. PONS o How would you fix this bug? - 1 points UserChoice - stro numitems- int CostPerDay 35 DayCare = 20 Training TotalCost float) cost - float 65 UserChoice - input("Enter your choice of day care options B Boarding, D- Daycare or T = Training:") name - input("Enter the name of your dog:") if UserChoice -- "B": numitems - (input("How many nights will your dog be stay ing with us? ==> ") cost - Cost PerDay elif UserChoice == "D" numitems int(input("How many days of daycare is your d og attending? ==> ")) cost- DayCare else: numitems = int(input("How many training sessions do you wish to researve? --> ") cost - Training #end if Total numitems + cost print("Dog Name: name) print("Total is: $", Total)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
