Help creating date/calander

I'm trying to implement a Date class to create a simple application for " Major U.S. holidays calendar System ", that provides a list of major holidays for a given year AND prints the calendar for the given year either online or write to a file.

I need help finishin up the class date.h, which is
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef DATE_H
#define DATE_H
#include <string>
#include <iostream>
using namespace std;

string Month[]={"" , "January", "Febraury", "March", "April", "May", "June", "July",
	"August", "September", "October", "November", "December"};

int daysInMonth[2][13] = { { 0,31,28,31,30,31,30,31,31,30,31,30,31} ,
							{ 0,31,29,31,30,31,30,31,31,30,31,30,31} };
string DOW[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturady"};
class Date{

private:
	int *month ;
	int *day ;
	int *year ;

public:

	// constructors

	Date(int month, int day, int year) ;
	Date()  ;     // default constructor

	Date(Date &other) ;  // copy constructor
	Date(string mmddyyyy) ;  // constructor that takes a string as parameter e.g "10/31/2012"

	~Date() ;

	// overlaod assignment operator 

	Date & operator=(Date & rhs) ;
	Date & operator++() ;
	Date & operator++(int) ;
	Date & operator--() ;
	Date & operator--(int) ;
	bool operator ==(Date & rhs) ;
	bool operator != (Date & rhs) ;
	bool operator > (Date & rhs) ;
	bool operator < (Date & rhs) ;

	int operator-(Date & rhs) ;     
	Date & operator+(int ) ;
	


	// accessors

	int getDay() ;
	int getMonth() ;
	int getYear() ;

	bool valid(int m, int d, int y);   // validate the triple is indeed a valid date
	string toAscii(int n) ;		//  string representation of the integer
	
	static Date toDate(int doy, int yr) ;  // 

	void display() ;   // display date in the format of   mm/day/year e.g. 10/31/2012
		

	string toString() ; // returns the string format of dayOfWeek Month Day, Year  e.g. Wednesday October 31, 2012



	// returns true if the given year is a leap year and false otherwise

	static int isLeap(int year) {

	     return (( year % 400 == 0  ) || ( year % 4 == 0  && year % 100 != 0 )) ;
   }

	// returns the day code the the new year day of the given year

	static int get_day_code( int year ) {
                return ( year + ( year - 1 ) / 4 - ( year - 1 ) / 100
                             + ( year - 1 ) / 400 ) % 7;
   }
	// overloading get_day_code that returns the day code of the specific day
	
	static int get_day_code(int year, int month , int day);

	
	

	int dayOfWeek();		// return the day code of this day ;
	


	int dayOfYear() ; 		// returns the day of the year, eg,  the day of year for Feb 28 is 59.




};


Then, i need help implementing the code for each holiday. using this code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#include <iostream>
#include <string>
#include <iomanip>
#include "Date.h"
#include <fstream>

using namespace std;

void app1() ;
void app2() ;
void print_calendar( int year );
char *major[]={"New Year Day","MLK Birthday","Valentine's Day","President Day","St.Patrick's Day","April Fools","May Day","Mother's Day",
	"Memorial Day","Father's Day","Independence Day","Labor Day",
	"Columbus Day","Halloween","Election Day", "Veterans Day","Thanksgiving Day", "Christmas"};
char * dayofweek[] = {"Sunday", "Monday", "Tuesday","Wednesday", "Thursday", "Friday", "Saturday"};

void print_calendar( int year, ostream &out );


void menu() {
	cout << "\n\t\tType 1 for major holidays ";
	cout << "\n\t\tType 2 for Calendar  ";
	cout <<"\n\t\tType 3 to quit.";
	cout << "\n\n\t\tPlease enter your choice :";;
		
}
int main() {
	
	int choice ;
	cout << endl << endl << "\tWelcome to CSC262  Holidays/  Calendar System: \n\n";
	while (true) {
		menu() ;
		cin >> choice ;

		switch(choice) {
		case 1:  app1() ; break ;
		case 2 : app2() ; break ;
		case 3: break ;
		default:  cout << "\n\n\t\tInvalid choice \n"; break;
		} 
		if ( choice == 3 ) break ;

	}

	cout << "\n\n\tThank you for using U.S. Major Holidays Calendar System! \n";
	cout << "\n\n\t\tBye! \n\n";
	return 0 ;
}




///////////////////////////////
Date NewYear(int yr) {
	Date tmp(1,1,yr) ;
	return tmp ;
}
// MLK day third monday of January
Date MLKDay(int yr) {

// I need help here!
}

Date Valentine(int yr) {
	return Date(2,14,yr) ;
}

Date PresidentDay(int yr) {  // 3rd monday of Febraury

// I need help here!

}
Date StPatrick(int yr) {  //mar 17

	Date temp(3,17,yr) ;
	return temp;
}

Date AprilFool(int yr){
	return Date(4,1,yr) ;
}

Date MayDay(int yr) {  // May ist
	Date tmp(5,1,yr) ;
	return tmp ;
} 
Date MotherDay(int yr) {  // 2nd sunday in may
// I need help here!

}
Date MemorialDay(int yr) {  
// function that returns a Date object which is the date for Memoriial day of year yr

// I need help here!

}

Date FatherDay(int yr) {  // 3rd sunday in June
// I need help here!
}

Date IndependenceDay(int yr) {  // July 4

	Date tmp(7,4,yr) ;
	return tmp;
}


Date Labor(int yr) {
	
// function that returns a Date object which is the date for Labor day of  the year yr
// I need help here!
}

Date Columbus(int yr) {  // second monday of october

// I need help here!
}

Date Halloween(int yr) {
	Date tmp(11,1,yr) ;    // november 1st, a day after Halloween
	return --tmp  ;
}
Date ElectionDay(int yr) {  // 1st tuesday after 1st monday in november
// I need help here!
}

 Date VeteransDay(int yr ) {    // Nov 11

	Date temp(11,11,yr) ;
	return temp;

}

 Date thanksgiving (int yr) {
// function that returns a Date object which is the date for Thanksgiving of the year yr
//  the fourth thursday of Novemeber


// I need help here!
}

 Date xmas(int yr) {
	 return Date(12,25,yr) ;
 }


 // an array of  function pointers
Date   (*fp[18])(int)= { NewYear, MLKDay,Valentine,PresidentDay,StPatrick,AprilFool,MayDay,MotherDay,MemorialDay,
                           FatherDay,IndependenceDay,Labor,Columbus, Halloween,ElectionDay,VeteransDay,thanksgiving,xmas } ; 


void process(   Date (*fun)(int), int yr, int index){

	Date d = fun(yr) ;


	// I need help here!
}


void app1() {

	
	int yr ;

	while(true) {

		cout << "\tPlease enter the year (4 digits) or -1  to quit: " ;
		cin >> yr ;
		if ( yr < 0 ) break ;
		cout <<  "\n\n\t\tMajor holidays for year " << yr << endl << endl;


		for (int i = 0 ; i < 18 ; i++ ) process(fp[i],yr,i) ;

		cout << endl << endl;
	}

}

void app2() {

	
	int yr ;
	char resp[10];
	string filename; 
	ofstream out;

	cout << "\n\tDo your want to write to a file?";
	cin >> resp;

	if ( resp[0] == 'y' || resp[0] == 'Y'){
		cout << "\n\tPlease enter the file name: ";
		cin >> filename;
		filename += ".txt";
		out.open ( filename, ios::app );
	}
	
	while(true) {

		cout << "\tPlease enter the year (4 digits) or -1  to quit: " ;
		cin >> yr ;
		if ( yr < 0 ) break ;
		cout <<  "\n\n\t\tCalendar for year " << yr << endl << endl;

		if ( resp[0] == 'y' || resp[0] == 'Y' ) print_calendar(yr,out) ;
		else print_calendar(yr,cout) ;
		
		cout << endl << endl;
	}
	if (resp[0] == 'y' || resp[0] == 'Y' ) out.close() ;
}

void print_calendar( int year, ostream &out ) {
 // I need help here!
}




I've commented where I need help.

I'm have no clue what to do to finish this, and it's taken me a while to get what i've got. any help is appreciated
I'm trying to mimic this programs's output:
Welcome to CSC262  Holidays/  Calendar System: 


		Type 1 for major holidays 
		Type 2 for Calendar  
		Type 3 to quit.

		Please enter your choice :1

	Please enter the year (4 digits) or -1  to quit: 2013

		Major holidays for year 2013

	New Year Day         | Tuesday     1/1/2013             
	MLK Birthday         | Monday      1/21/2013            
	Valentine's Day      | Thursday    2/14/2013            
	President Day        | Monday      2/18/2013            
	St.Patrick's Day     | Sunday      3/17/2013            
	April Fools          | Monday      4/1/2013             
	May Day              | Wednesday   5/1/2013             
	Mother's Day         | Sunday      5/12/2013            
	Memorial Day         | Monday      5/27/2013            
	Father's Day         | Sunday      6/16/2013            
	Independence Day     | Thursday    7/4/2013             
	Labor Day            | Monday      9/2/2013             
	Columbus Day         | Monday      10/14/2013           
	Halloween            | Thursday    10/31/2013           
	Election Day         | Tuesday     11/5/2013            
	Veterans Day         | Monday      11/11/2013           
	Thanksgiving Day     | Thursday    11/28/2013           
	Christmas            | Wednesday   12/25/2013           


	Please enter the year (4 digits) or -1  to quit: -1

		Type 1 for major holidays 
		Type 2 for Calendar  
		Type 3 to quit.

		Please enter your choice :2

	Do your want to write to a file? n
	Please enter the year (4 digits) or -1  to quit: 2013


January

Sun  Mon  Tue  Wed  Thu  Fri  Sat
            1    2    3    4    5
  6    7    8    9   10   11   12
 13   14   15   16   17   18   19
 20   21   22   23   24   25   26
 27   28   29   30   31  

February

Sun  Mon  Tue  Wed  Thu  Fri  Sat
                           1    2
  3    4    5    6    7    8    9
 10   11   12   13   14   15   16
 17   18   19   20   21   22   23
 24   25   26   27   28  

March

Sun  Mon  Tue  Wed  Thu  Fri  Sat
                           1    2
  3    4    5    6    7    8    9
 10   11   12   13   14   15   16
 17   18   19   20   21   22   23
 24   25   26   27   28   29   30
 31  

April

Sun  Mon  Tue  Wed  Thu  Fri  Sat
       1    2    3    4    5    6
  7    8    9   10   11   12   13
 14   15   16   17   18   19   20
 21   22   23   24   25   26   27
 28   29   30  

May

Sun  Mon  Tue  Wed  Thu  Fri  Sat
                 1    2    3    4
  5    6    7    8    9   10   11
 12   13   14   15   16   17   18
 19   20   21   22   23   24   25
 26   27   28   29   30   31  

June

Sun  Mon  Tue  Wed  Thu  Fri  Sat
                                1
  2    3    4    5    6    7    8
  9   10   11   12   13   14   15
 16   17   18   19   20   21   22
 23   24   25   26   27   28   29
 30  

July

Sun  Mon  Tue  Wed  Thu  Fri  Sat
       1    2    3    4    5    6
  7    8    9   10   11   12   13
 14   15   16   17   18   19   20
 21   22   23   24   25   26   27
 28   29   30   31  

August

Sun  Mon  Tue  Wed  Thu  Fri  Sat
                      1    2    3
  4    5    6    7    8    9   10
 11   12   13   14   15   16   17
 18   19   20   21   22   23   24
 25   26   27   28   29   30   31


September

Sun  Mon  Tue  Wed  Thu  Fri  Sat
  1    2    3    4    5    6    7
  8    9   10   11   12   13   14
 15   16   17   18   19   20   21
 22   23   24   25   26   27   28
 29   30  

October

Sun  Mon  Tue  Wed  Thu  Fri  Sat
            1    2    3    4    5
  6    7    8    9   10   11   12
 13   14   15   16   17   18   19
 20   21   22   23   24   25   26
 27   28   29   30   31  

November

Sun  Mon  Tue  Wed  Thu  Fri  Sat
                           1    2
  3    4    5    6    7    8    9
 10   11   12   13   14   15   16
 17   18   19   20   21   22   23
 24   25   26   27   28   29   30


December

Sun  Mon  Tue  Wed  Thu  Fri  Sat
  1    2    3    4    5    6    7
  8    9   10   11   12   13   14
 15   16   17   18   19   20   21
 22   23   24   25   26   27   28
 29   30   31  


	Please enter the year (4 digits) or -1  to quit: -1

		Type 1 for major holidays 
		Type 2 for Calendar  
		Type 3 to quit.

		Please enter your choice :2

	Do your want to write to a file? y

	Please enter the file name: xxx    


	Please enter the year (4 digits) or -1  to quit: -1
		Type 1 for major holidays 
		Type 2 for Calendar  
		Type 3 to quit.

		Please enter your choice :3

	Thank you for using U.S. Major Holidays Calendar System! 


		Bye! 

Topic archived. No new replies allowed.