499987 An event class with time and date objects
N/A
Teslim sırasında ödenir
i need this by sunday 5/22/11 at noon if possible.
1. Create a project which consists of three classes: an Event class, a Time class, and a Date class.
2. The Event class should have data members that are objects of the Time and Date class.
STEP 2: the Event and Time Classes
1. the code for the Event and Time classes should include all necessary function and constructor implementation code.
STEP 3: Design a Date Class
1. Design a Date class that has three data members to represent the year, month, and day.
2. Date-class member functions should be able to
set the date,
return the date,
print the date, and
add a default constructor and a constructor with parameters.
STEP 4: Construct Main Method
1. Construct the main method so that it can test the member functions of each of the classes by creating an Event object and then performing the necessary operations to test all possible behavior.
This is what i have so far.
#include <iostream>
#include <string>
using namespace std;
class Time
{
//this is a simple time class to demonstrate the use of one
//object within another class (composition)
public:
void setTime(int, int);
void getTime(int&, int&);
void printTime() const;
void incrementMin();
void incrementHrs();
Time(int, int); // constructor with parameters
Time(); // the default constructor
private:
int hour;
int minute;
};
class Event
{
publilc:
void setEventData(string eventName, int hour, int minute, int month, int day, int year);
// this is the prototype of the function to set the data for
// the event
void printEventData() const;
Event(string eventName = 1, int day = 1, int year = 1900);
// Constructor
private:
string eventName;
Time eventTime; // the event object is composed of a time object
dateType eventDay //and a date object
};
Proje NO: #2245907