Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 expectedStep 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