Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This lab aims to review debugging concepts covered in Chapter 5 as well as the previous chapters. In this lab you will have to review

image text in transcribed
image text in transcribed
This lab aims to review debugging concepts covered in Chapter 5 as well as the previous chapters. In this lab you will have to review the code below and identify and correct the errors. What the program is intended to do: For everyone whose birthday is June 12, the program will calculate their current age, ask for a year in the future, and tell how old they will be that year. Unfortunately, it has several errors that you will have to fox. Again, the purpose of these debugging labs is to get you used to the process of debugging code by observing what happens with certain error types, and learning how to isolate the errors and fix them. So run the program as is first to see the errors, then fix one error at a time, run again, fix one error, etc until they are all fixed. Once you have corrected all errors, if the input is: 2000 2050 Then the output will be: Enter a year of birth: 2000 Your birthday is: 6 / 12 / 2000 Enter a year in the future: 2050 You will be 50 years old! How To Approach Debugging Run the Code If the code fails to run find the line of the error then look on previous lines until you find its source For example, in the code below, the error is in the first line where the input is missing its closing parentheses X - input print (x) . But the error will say as follows: File "main.py", line 2 print (x) But the error will say as follows: File "main.py", line 2 print (x) SyntaxError: unexpected EOF while parsing The point is that even for syntax errors, the Python interpreter may be reporting a line that is later than the line where the actual error occurred. ACTIVITY 16.12.1: Lab 5D: Debugging Lab Part 3 0/25 main.py Load default template... 1 year - input("Enter a year of birth: ')) # Fix me 2 birthyear - year Fix me 4 age - Zeze - birthyear 6 month - June Fix me 7 birthmonth - int(month) 9 # Fix me 10 day="12" 11 birthday - int(day) 13 print("Your birthday ts: , birthmonth birthday birthyear) # Fix me 15 randon_year - int(input("Enter a year in the future: ')) 17 # Fix ne x2 18 Print("You will be', random_year - birthyear, 'years old!) Develop mode Submit mode Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions

Question

3 > O Actual direct-labour hours Standard direct-labour hours...

Answered: 1 week ago