Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the following date class interface: class date {private: int month;//1 - 12 int day;//1 - 28. 29. 30. 31 depending on month & year

image text in transcribed
Given the following date class interface: class date {private: int month;//1 - 12 int day;//1 - 28. 29. 30. 31 depending on month & year int year;//4-digit, e.g.. 2017 public: date();//Default constructor (investigate; find what it is used for)//Postcondition: the newly declared date object is initialized to 01/01/2000 date(int mm, int dd, int yyyy);//Second constructor//Postcondition: the newly declared data object is initialized to mm/dd/yyyy void setDate(int mm. int dd. int yyyy);//Postcondition: set the contents of the calling date object to the values passed to the function void displayDateV1();//Postcondition: display the calling date object in mm/dd/yyyy format, e.g., 02/22/2017 void displayDateV2();//Postcondition: display the calling datecobject in the format like: February 22. 2017 int compareDates(date &dObj);//compares the two date objects: the calling one the dObj that is passed to the function//Postcondition: returns - 1. 0. or 1 if the calling date object if less than, equal to, or greater than dObj. respectively.}; Your are asked to: Implement all six member functions: Write a main() function containing C++ code to test all six member functions. Note that for the compareDates function, you must test all three possibilities! Format you program output so make it easily readable

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions

Question

=+what kinds of policies and practices should be developed?

Answered: 1 week ago

Question

=+ Of the HR issues mentioned in the case,

Answered: 1 week ago