Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please code in c++ Write a program that prompts the user to enter a person's birth date in numeric form (e.g. 8-27-1990) and outputs the
please code in c++
Write a program that prompts the user to enter a person's birth date in numeric form (e.g. 8-27-1990) and outputs the date of birth in the format of month day, year (e.g. August 27, 1990). Your program must work for three types of exceptions- invalid day, invalid month and invalid year (year must be between 1915 and 2017). Make these as class driven exceptions. Program 1 Use one try-catch block with separate catches for the exception classes to handle errors for invalid day and month and a catch all to handle invalid year. Print the correct exception method error and have the user re-enter the error field value (assume the user will enter a correct value). Then print out converted date. Program 2: Use nested try-catch blocks to print the appropriate error message for the error in the internal try-catch block(s). Re-throw the exception and ask the user to re-enter the error field value in the outer try-catch block. Then print out the converted date. Submission based on Turn-In templateStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started