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:
Dateint mm int dd int yy
year yy;
month mm;
day dd;
Datestring input
char temp;
istringstreaminput 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
return false;
year is divisible by
if year
return true;
year is not divisible by
if year
return false;
year is divisible by but not divisible by
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:
Timeint hh int mm int ss
hour hh;
minute mm;
second ss;
Timestring input
char temp;
istringstreaminput hour temp
minute temp second;
second: : increment minute
minute: : increment hour
hour: : hour
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 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
