Calender CPP
Calender CPP
n ewDescription); Appointment(); void setTime(string); void setPlace(string); void setSummary(string); void setDescription(string); string getTime(); string getPlace(); string getSummary(); string getDescription(); private: string time; string place; string summary; string description; }; Appointment::Appointment(string newTime, string newPlace, string newSummary, str ing newDescription) { time = newTime; place = newPlace; summary = newSummary; description = newDescription; } string Appointment::getTime() { return time; } string Appointment::getPlace() { return place; } string Appointment::getSummary() { return summary; } string Appointment::getDescription() { return description; } void Appointment::setTime(string newTime) { time = newTime; } void Appointment::setPlace(string newPlace) { place = newPlace; } void Appointment::setSummary(string newSummary) {
summary = newSummary; } void Appointment::setDescription(string newDescription) { description = newDescription; } class Planner { public: Planner::Planner(int accounts); Planner::~Planner(); int getNumberOfAppointments() { return app_nr; }; Appointment* getAccount(int i); private: Appointment* app_list; int app_nr; }; Planner::Planner (int accounts) { this->app_list = new Appointment[accounts]; this->app_nr = accounts; } Planner::~Planner() { delete [] this->app_list; } Appointment* Planner::getAccount(int i) { if (i > 0 && i < app_nr) return &app_list[i]; else return NULL; }