Hi,
Thank you for your support. I am new to C++ and have started working with classes. I understand constructors, accessors and mutators. I have a program that I am working on and I am implementing my classes. I have six classes and have completed four. The top two, Calendar and appointment require me to have functions from my other classes (i.e. in class appointment, Time getstarttime or Location getLocation.) Can anyone help me on how to implement these? Also I am a bit confused in passing a vector through a constructor. any help will be much appreciated! Thank you. I have pasted my code:
class Calendar
{
public:
Calendar();
Calendar(Appointment mname);
void AddToCalendar(Appointment mname);
void RemoveFromCalendar(Appointment mname);
private:
vector < Appointment > meetings;
}; // Calendar
class Appointment
{
public:
Appointment();
Appointment(vector< person > alist, Time stime, Time etime, Date d, Location p);
vector< Person > getAttendees()
Time getStartTime()
Time getEndTime()
Date getDate()
Location getLocation();
private:
vector< Person > attendees;
Time starttime;
Time endtime;
Date date;
Location place;
}; // Appointment
class Person
{
public:
Person();
Person(string firstname, string lastname, string company);
string getFirstName();
string getLastName();
string getCompany();
private:
string firstname;
string lastname;
string company;
}; // Person
Person::Person(string firstname, string lastname, string company);
{ this -> lastname = lastname;
this -> firstname = firstname;
this -> company = company;
}
string Person::getFirstName()const;
{ return firstname;}
string Person::getLastName()const;
{ return lastname;}
string Person::getCompany()const;
{return company;}
class Location
{
public:
Location();
Location(string address, string building, string room);
string getLocationAddress();
string getLocationBuilding();
string getLocationRoom();
private:
string address;
string building;
string room;
}; // Location
Location::Location(string address, string building, string room);
{ this -> address = address;
this -> building = building;
this -> room = room;
}
string Location::getLocationAddress()const;
{ return address;}
string Location::getLocationBuilding()const;
{ return building;}
string Location::getLocationroom()const;
{return room;}
class Date
{
public:
Date();
Date(int month, int day, int year);
int GetMonth();
int GetDay();
int GetYear();
private:
int month;
int day;
int year;
}; // Date
Date::Date(int month, int day, int year);
{ this -> month = month;
this -> day = day;
this -> year = year;
}
int Date::GetMonth()const;
{ return month; }
int Date::GetDay()const;
{ return day; }
int Date::GetYear()const;
{return year; }
class Time
{
public:
Time();
Time(int hour, int minute);
int GetHour();
int GetMinute();
private:
int hour;
int minute;
}; // Time
Time::Time(int hour, int minute)
{ this -> hour = hour;
this -> minute = minute;
}
int Time::GetHour()const;
{ return hour; }
int Time::GetMinute()const;
{ return minute; }
thanks again,
wander