Question: In visual studio C++ Write a class definition for a Date class that contains 3 private integer data members: month, day, and year Create public
In visual studio C++

Write a class definition for a Date class that contains 3 private integer data members: month, day, and year Create public member functions setDate() and showDate(). The set Date) function should accept 3 integer arguments and use them to set the private members month, day, and year. If the user provides invalid information for the day or month, set it to a default of 1. (ex. if the user enters a month of O and day of 32, set the month to 1(January) and day to 1st) (this is different than allowing the user to call setDate) with zero input arguments and using defaults for all3 values) The error checking should be very precise. Ex. Since April only has 30 days, no one should be able to set a date of April 31st. The error checking for February should account for the fact that Feb has 28 days during some years and 29 days other years. The program should also be able to recover if the user types in letters when numeric input is expected
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
