Question: implement the following two parts using only composition Part1(Composition): Implement a class called Time. The Time class will have two private data members: int hr;

implement the following two parts using only composition
Part1(Composition):
Implement a class called Time. The Time class will have two private data members:
int hr;
int min;
You have to implement the following functions for time class
Time();
Time(int, int);
void setTime(int, int);
void getTime(int&, int&);
void printTime();
void incrementHours();
void incrementMinutes();
Implement a class called Date. The Date class will have three private data members:
int month;
int day;
int year;
You have to implement the following functions for Date class
Date();
Date(int, int, int);
void setDate(int, int, int);
void getDate(int&, int&, int&);
void printDate();
3. . Implement a class called Event. The Event class will have three private data members:
string eventName;
Time eventTime;
Date eventDay;
You have to implement the following functions for Event class
Event(int hours = 0, int minutes = 0, int m = 1, int d = 1, int y = 1900, string name =
"Christmas");
void setEventData(int hours, int minutes, int m, int d,
int y, string name);
void printEventData();
Your Main function should be like this
int main()
{
//instantiate an object and set data for Christmas
Event object;
object.setEventData(6, 0, 12, 25, 2010, "Christmas"); //print out the data for object object.printEventData();
//instantiate the second object and set date for the
fourth of July
Event object2;
object2.setEventData(1, 15, 7, 4, 2010, "Fourth of July");
//print out the data for the second object
object2.printEventData();
return 0; }
Please define each function outside the class properly.
Part2 (Composition)
1.Implement a class called Birthday. The Birthday class will have three private data members:
int month;
int day;
int year;
Write Following functions for it.
Constructor (default and parameterized)
All setters and getters
printBirthDate()
2.Implement a class called Person. The Person class will have following private data members:
char ** name;
char * Gender;
int contactNo;
char * email;
Birthday dateOfBirth;
Write Following functions for it.
Constructor (default and parameterized)
All setters and getters
printInfo ()
Destructor
Write a main function that should call all function display person info including date of birth in proper format. printInfo function should be call to display all info.

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!