Based on the provided images, an explicit question title is not visible on the screen, but the core function is named convertDobFormat.
Here is the exact problem statement transcribed verbatim from the screenshots:
During account registration, users enter their Date of Birth (DOB) in the format DD/MM/YYYY. Your task is to validate the given DOB string and generate a 6-character user identifier.
If the DOB is valid, print the identifier in the format DDMMYY (day + month + last two digits of year). If the DOB is invalid, print 'Invalid Date'.
Read the input from STDIN and print the output to STDOUT. Do not print arbitrary strings anywhere in the program, as these contribute to the output and test cases will fail.
The only line of input will consist of a string dob, representing the user's Date of Birth in the format DD/MM/YYYY.
The only line output should display a string representing the user identifier in the format DDMMYY, where DD is the two-digit day of birth, MM is the two-digit month of birth, and YY is the last two digits of the year of birth. Also, if the input is invalid, output "Invalid Date".
01/01/1990
010190
Explanation 1: Following the mentioned constraints above and the problem statement, the generated password will be '010190', which will be displayed as an output.
12/07/2005
120705
Explanation 2: Following the mentioned constraints above and the problem statement, the generated password will be '120705', which will be displayed as an output.
i. dob must always have a length of exactly 10 characters (in the format DD/MM/YYYY), including the slashes.
ii. The day (DD) should be between 01 and 31.
iii. The month (MM) should be between 01 and 12.
iv. The year (YYYY) should be a 4-digit number between 1000 and 9999.
v. If the month is February, ensure the day is valid (between 01 and 29 for a leap year or between 01 and 28 for a non-leap year).
Jefeeerirs • Pending