Question: C++ (Date Class) Create a class called Date that includes three pieces of information as data membersa month (type int), a day (type int) and
C++
(Date Class) Create a class called Date that includes three pieces of information as data membersa month (type int), a day (type int) and a year (type int). Your class should have a constructor with three parameters that uses the parameters to initialize the three data members. For the purpose of this exercise, assume that the values provided for the year and day are correct, but ensure that the month value is in the range 112; if it isnt, set the month to 1. Provide a set and a get function for each data member. Provide a member function display Date that displays the month, day and year separated by forward slashes (/). Write a test program that demonstrates class Dates capabilities.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
