Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Analyze the Python code written below. There are 3 errors. In the space below identify the line that contains the error, the type of

image text in transcribed 

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. 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 program 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 What kind of bug is it? (logical, syntax, run-time) = 0.5 points How would you fix this bug? = 1 points UserChoice = str() numitems = int() CostPerDay = 35 DayCare 20 Training = 65 Total = float() cost = float() UserChoice = input("Enter your choice of day care options B = Boarding, D = Daycare o r T = Training: ") name = input("Enter the name of your dog: ") if UserChoice == "B": numitems = (input("How many nights will your dog be staying with us? ==> ")) cost = CostPerDay elif UserChoice == "D" numitems = int(input("How many days of daycare is your dog attending? ==> ")). else: cost = Day Care 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

3.38 Rating (145 Votes )

There are 3 Steps involved in it

Step: 1

SureI can help you analyze the Python code The prompt asks you to identify three errors in the code ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Taxation Of Individuals And Business Entities 2016

Authors: Brian Spilker, Benjamin Ayers, John Robinson, Edmund Outslay, Ronald Worsham, John Barrick, Connie Weaver

7th Edition

9781259425479, 125942121x, 1259334872, 1259425479, 9781259421211, 978-1259334870

More Books

Students also viewed these Finance questions

Question

Establish identity. 1 + sin 0 1 - sin 0 csc e + 1 csc 0 - 1

Answered: 1 week ago

Question

What do you know of my (the interviewers) research program?

Answered: 1 week ago

Question

=+ How did Rogers define each quality?

Answered: 1 week ago