How to create a class called date


Problem:

Create a class called Date that includes three pieces of information as data members:

• Month (type int),

• Day (type int) and

• Year (type int).

Your class should have:

• A constructor with three parameters that uses the parameters to initialize the three data members.

• Ensure that the month value is in the range (1-12); if it is not, set the month to 1.

• Provide a set and a get function for each data member.

• Provide a member function displayDate that displays the month, day and year separated by forward slashes (/).

Required:

Question: Write a test program that demonstrates class Date's capabilities. Provide the 3 usual files (interface, implementation and driver).

 

Please describe the coding of the test program that demonstrates class Date's capabilities.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: How to create a class called date
Reference No:- TGS0892823

Expected delivery within 24 Hours