I'm trying to write two classes and make aggregation of the two classes: one to get one'd birthday and the other check if the bday is in certain range.
I have built the one getting bday so far as below:
Date.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14
class Date{
public:
Date();
Date(int month, int day);
int month() const;
int day() const;
void setMonth(int month);
void setDay(int day);
private:
int bdayMonth;
int bdayDay;
};
I know I cannot check each parameter from another class function date can be checked in this way but I don't know how I can check each parameter of date//
how should i build it?
now I'm building another class that check if the bday is in certain range:
that is the sole raison d'etre for the other class then you might as well just have a function returing bool and taking an argument of type Data that performs the same check