Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 template

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions