Question: 4 . Write a program for a driving school. Your program will enter the details of many students, and then print out all the details

4. Write a program for a driving school. Your program will enter the details of many students, and then print out all the details using Python.
Input
In real life, you might use a form for entering data, but for the sake of this exam question, please use the input() function.
For each student record, the user of your software needs to enter the following fields in order:
permit_number: the student's/learner's permit number issued by the state.
first_name: the given name of a driving student of the school.
last_name: the surname of a driving student of the school.
date_of_birth: the date of birth of the student.
Input is terminated using a permit_number of "END".
Validation as part of the Input
You will need to validate the following fields:
the learner's permit number needs to be valid. See is_good_permitnum() below. The permit number must be a nine-digit number. The first digit must be 0.
the given name and surname must not be empty strings.
the date of birth needs to be a valid date. We assume the user will enter the date of birth as a single string according to the format: year-month-day. e.g."1965-11-23","1988-1-3". Please leave this date as a string. Do not convert it to a date object. See is_good_date() and requirements below. You should validate:
year>1960
1<= month <=12
1<= day <= days_in_month
days_in_month =30 if the month is 4,6,9 or 11
days_in_month =31 if the month is 1,3,5,7,8,10 or 12
days_in_month =28 if the month is 2(Leap year is not considered in the question)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!