Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me solve this question fast! I don't have much time so correctly using python. Also refer to the examples provided. Exception handling and

Please help me solve this question fast! I don't have much time so correctly using python. Also refer to the examples provided.

image text in transcribed

Exception handling and the range () function (0.5 points) Even if your code runs correctly for Problem 3 above, it is still possible for users to enter in non-sensical date values. See Example 10, where a user could enter 00 for a month and 59 for a date and the program would still continue. This is an example of a logic error. Exception handling is the process of responding to unwanted or unexpected events in a computer program. Modify your script with additional selection statements so that only valid months and dates will be accepted, and the program will end print an error message if an invalid month or date is entered. You can assume that the user will always enter integer numbers. Below are a few sample runnings of the program. Underlined text indicates user input. Example 1 Enter birth month (MM) : 13 Invalid month entry. Example 2 Enter birth month (MM) : 4 Invalid month entry. Example 3 Enter birth month (MM) : 05 Enter birth day (DD) : 32 Invalid birth day entry. Example 4 Enter birth month (MM): 05 Enter birth day (DD) : 00 Invalid birth day cntry. Example 5 Enter birth month (MM): 10 Enter birth day (DD) : 23 Enter PIN: 1024 Valid PTN

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

Bioinformatics Databases And Systems

Authors: Stanley I. Letovsky

1st Edition

1475784058, 978-1475784053

More Books

Students also viewed these Databases questions