Object Oriented c++ Assignment help

Hello guys, I have the Object Oriented c++ programming course and I've been doing great, but there's an assignment with 25 points that I can't figure out , the reason is I got an accident and went to the hospital for 8 days and missed alot of classes , so if anyone could help me with it it would be much appreciated , I don't know how can I post the file here, so if someone would post me his/her email I will send it.. Thanks much.
Just post your question, with whatever work you have attempted. If you're stuck, tell us exactly where you're stuck at.
Here's the first class :

Part1 . Implement the class Date defined as follows:
/* Date.h */
#ifndef DATE_H_
#define DATE_H_
class Date {
public:
Date(); // constructor
void setDate( int, int, int ); // set day, month, year
friend ostream & operator<<(ostream &, Date &); // print date format "month dd, yyyy (example: January 11, 2013)
friend istream & operator>>(istream &, Date &); // to read date
private:
int day;
int month;
int year; //
};
#endif /* DATE_H_ */


and here's what I did :

#include "Header.h"
#include <iostream>
using namespace std;

class Date {
public:
Date();
void setDate( int d, int m, int y )
{
day=d;
month=m;
year=y;
}

private:
int day;
int month;
int year; //
};


ostream & operator<<(ostream & out, Date & x)
{
out<< x.d << "/" << x.m << "/" << x.y ;
return out;
}
istream & operator>>(istream & in, Date & x)
{
in>> x.d >> x.m >> x.year ;
return in;
}

it's telling me that Date has no members d,m or y .. I can't use them because they are private so what should I do ?
Last edited on
Also I don't understand why did he put a set function when I am going to use cin to get data ?
Topic archived. No new replies allowed.