Question: C++ Assignment Create a class called Date that has integer data members to store month, day, and year. The class will have a 3-parameter constructor

 C++ Assignment Create a class called Date that has integer data

C++ Assignment Create a class called Date that has integer data members to store month, day, and year. The class will have a 3-parameter constructor that allows the date to be created by specifying the numerical month, day, and year. If the user creates a Date object when any of the values passed are invalid, an invalid argument exception should be thrown with appropriate text: The month must be a valid month (1-12), The day must be in the appropriate range for that month (do not worry about leap years), and The year must be between 1950 and 2020. Include mutator methods for setting the month, day, and year. These should also throw invalid parameter exceptions if invalid parameters are provided. Include a toString) method that displays the date in the format "Month DD, YYYY" (ex: August 22, 1984) Create a program that utilizes this class to create and display dates based on user input. Utilize try-catch blocks to validate the user input. Demonstrate usage of the class and its embedded exception handling

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!