Need a little help with class

Here is a single step for part of my homework. equaltdate is a function I have to implement into my class.
6. equalDate the dates of two Appointment objects, r eturn true if they are the same and false otherwise.

Here is what I have so far:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Appointment
{
private:
string name;
Date date;
public:
void print() const;
void setName();
int getName();
void setDate();
int getDate();
bool equalDate(const Date obj) const;
Appointment(int y=1900, int m=1, int d=1);

};
Last edited on
1) Your getName() function returns an int instead of a string.
2) your getDate() function also returns an int instead of a Date object.

as name and date are private, you'll need to fix those functions to do a proper comparison.
Topic archived. No new replies allowed.