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 month(type int) a dars a should have a constructor with three parameters that use the parameters to initialize the three data int), a day(type int) and a year(type that the values provided for the vear and day are correct, but ensure that the month value is in the range 11-12. For the purpose of thise exercise, assume to the main.cpp program given below. (25 points)
*include riostreams
"include "Date. h""l" include definition of clat.
using namespace std;
If function main begins program execution
int main()
Date date(5,6,1981); "/ create a Date object for May 6,1981
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 5/6/1981
date.setmonth Date
date.setmonth (13); / invalid month
date.setrear (20 ; );
cout "InNew date:" endi;
b)// end main by using c++
Create a class called Date that includes three

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 Accounting Questions!