Write a program that prompts the user to enter a person’s date of birth in numer
ID: 3673421 • Letter: W
Question
Write a program that prompts the user to enter a person’s date of birth in numeric form such as 8-27-1980. The program then outputs the date of birth in the form: August 27, 1980. Your program must contain at least two exception classes: invalidDay and invalidMonth. If the user enters an invalid value for day, then the program should throw and catch an invalidDay object. Similar conventions for the invalid values of month and year. (Note that your program must handle a leap year.)
Explanation / Answer
#include using namespace std; int day; int month; int year; void inputDate (int) throw (int day, invalidDay, invalidMonth); int main() { try { cout 31) throw invalidDay; if(month==1) coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.