Question: Create a class called Date that includes three pieces of information as data members - a month ( type int ) a dars a should
Create a class called Date that includes three pieces of information as data members a monthtype int a dars a should have a constructor with three parameters that use the parameters to initialize the three data int a daytype int and a yeartype that the values provided for the vear and day are correct, but ensure that the month value is in the range For the purpose of thise exercise, assume to the main.cpp program given below. points
include riostreams
"include "Date. hl include definition of clat.
using namespace std;
If function main begins program execution
int main
Date date; create a Date object for May
II display the values of the three date data members
cout & "Inoriginal date, getyear endi;
cout "Inoriginal date:" endi; date.displaydate;
"I modify the Date output the Date as
date.setmonth Date
date.setmonth ; invalid month
date.setrear ; ;
cout "InNew date:" endi;
b end main by using c
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
