Question: #include #include #include using namespace std; / / define a class to store & print the date, also do increment operation class Date { public:

#include
#include
#include
using namespace std;
//define a class to store & print the date, also do increment operation
class Date
{
public:
Date(int mm=0, int dd=0, int yy=0)
{
year = yy;
month = mm;
day = dd;
}
Date(string input){
char temp;
istringstream(input)>> month >> temp
>> day >> temp >> year;
}
void display()
{
cout month '/' day '/' year;
}
//function to return true if year is leap year, false otherwise.
bool isLeapYear()
{
if (year %4)
return false;
// year is divisible by 4
if (year %400==0)
return true;
// year is not divisible by 400
if (year %100==0)
return false;
// year is divisible by 4, but not divisible by 100
return true;
}
//increment the day, if needed, increment the month,
//if needed, increment the year
void increment()
{
// WRITE YOUR CODE HERE
}
private:
int day, month, year;
};
//class to store time and display and do increment() operation
class Time
{
public:
Time(int hh=0, int mm=0, int ss=0)
{
hour = hh;
minute = mm;
second = ss;
}
Time(string input){
char temp;
istringstream(input)>> hour >> temp
>> minute >> temp >> second;
}
//second: 59-->60: increment minute
//minute: 59-->60: increment hour
//hour: 23-->24: hour=0
//return true if the day rolls over, return false otherwise.
bool increment()
{
// WRITE YOUR CODE HERE
}
void display()
{
// WRITE YOUR CODE HERE
}
private:
int hour, minute, second;
};
//composition - we used 2 objects: Date & Time objects
class DateTime
{
// WRITE YOUR CODE HERE
};
int main()
{
string dataType;
cin >> dataType;
// WRITE YOUR CODE HERE
}
In C++: Please fill in the above code to complete the assignment.
#include #include #include using namespace std; /

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