I typed out a basic solution of what I see the class looking like based upon your description. You seem to have the basic portion down, but I left out my implementation of setting the Day and Month because if I gave a full solution it wouldn't help you learn it. >.< I implemented up to the ComesBefore / ComesAfter, but thats rather easy once you deal with populating the class from the user input.
Code:
#include <time.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
using namespace std;
class Date {
public:
enum DAY { Sunday = 0,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday
};
enum MONTH { Janurary = 0,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
};
Date();
Date(MONTH m, DAY d, short int y, short int h, short int m, short int s);
MONTH GetMonth(); // Get Month of Date
void SetMonth(MONTH m); // Set Month of Date
char* Date(); // Get String Rep of the Entire Date
int GetDayOfTheMonth();
void SetDayOfTheMonth(short int dotm){if(dotm >=1 || dotm <= 31) dayofthemonth = dotm;};
int GetYear(){return (year-1900);};
void SetYear(short int y){if(y >= 0 && year <= 2009) year = y;};
int GetHours(){return hours};
void SetHours(short int h){if(h >= 0 || h <= 23) hours = h;};
int GetMinutes(){return minutes};
void SetMinutes(short int m){if(m >= 0 || m <= 59) minutes = m;};
int GetSeconds(){return seconds};
void SetSeconds(short int s){if(s >= 0 || s <= 59) seconds = s;};
DAY GetDayOfTheWeek(){return day;};
void SetDayOfTheWeek(DAY d);
bool ComesBefore(Date d);
bool ComesAfter(Date d);
private:
MONTH month;
DAY day;
short int hours, minutes, seconds, year, dayofthemonth;
}
edit: I don't know how far along you are, but I typed this up rather quickly just to shed another perspective on how I would go about it. D: in CS, there are always (usually) many solutions to a problem (with some being faster). So anyway, there's my take on it.
edit2: also, I assumed correct user input on days for each month as well as leap year. You could calculate if there are 31 days in the month etc, but I'd rather just assume it at this point since the code is nicer, lol, although it's not that difficult to add if it's necessary.