Question: Lab Exercise -- ADTs Implemented with C++ Classes Create a Date class that contains three private data members: month day (I leave it to you

 Lab Exercise -- ADTs Implemented with C++ Classes Create a "Date"

Lab Exercise -- ADTs Implemented with C++ Classes Create a "Date" class that contains three private data members: month day (I leave it to you to decide the type) year "setters" and "getters" for each of the data (6 functions in total) One advantage of a "setter is that it can provide error checking. Add assert statements to the setter to enforce reasonable conditions. For example, day might be restricted to between 1 and 31 inclu one default constructor (no arguments) .one constructor with three arguments: month, day, and year Add assert statements to enforce reasonable conditions. . a printDate function. This function will have no arguments and return void . a sameMonth function. This function will have one Date argument and a boolean return type In main in the following order): 1. instantiate one date object (datel) using the default constructor 2. use the setters to display the month, day, and year of datel (should print the default values) 3. read keyboard input from the user for a month day and year 4. use the setters to set the values of datel to the values that came from the user 5. read keyboard input from the user for a second date 9 PM 2020-02-03 Type here to search

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