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)