Help with classes

I am working on a program for my classes. I suck at coding and I don't understand it well. We are supposed to print out a calendar using classes and methods. I have a month class and the methods are in a separate cpp file from main. Here is the project description.

---------------------------------------------------------------------------------

Creating a Calendar Using Objects

You will create a calendar using objects belonging to two classes. The first class is called Month. The Month class contains static data members to store the following information:

Class constants that represent the days of the week. For example, you might represent Monday as a constant with the value 0, Tuesday as a constant with the value 1, etc.
Class constants that represent the months of the year. For example, you might represent January as a constant with the value 0, February as a constant with the value 1, etc.
The class will contain ordinary data members that store the following information for each the Month object:

Name of the month; e.g., "January", "March", etc.
Number of days in the month; i.e., 30, 31 or 28 (ignore Leap Years) NOTE: This data will be retrieved from a static class method, described below.
Day of the week that the month starts on; i.e., whether this particular month begins on a Monday, a Thursday, a Saturday, etc. NOTE: This data must be represented using class constants, as explained above.
Optional: Day of the week that the month ends on or that the following month begins on. NOTE: This data will be calculated, so you may decide whether to store it in a member or just create it when needed for the calendar. It's your choice.
The Month class will need methods to accomplish the following tasks:

A static method that provides the number of days in the month. Specifically, the method will have one parameter, an identifier for the month, and it will return the number of days in that month. For example, if the identifier for the month of January is passed in, this method will return the number 31 because January has 31 days. NOTE: The identifier will be one of the class constants, as explained above.
Initialize the month with data. Because each Month object will use only the default constructor (explained below), you must create a method to initialize it with the data mentioned above; i.e., the name of the month, the number of days in the month, and the day of the week that the month starts on.
Print the month to standard output. The format for printing is simple:
Print the name of the month
Print the days of the week; i.e., "Mon", "Tue", etc.
Print the dates in the month; i.e., "1", "2", etc.
Example: Suppose a Month object is assigned data representing the month of March, meaning it would have 31 days. Also, assume that this particular March begins on a Tuesday. Your Month object should print the following:
March

Mon Tue Wed Thu Fri Sat Sun

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
Once you have the Month class working properly, you will create a Year class. The Year class will contain the following data members:

An array of 12 Month objects. Because the array is statically created, the Month objects will necessarily use the default constructor, which will prevent you from constructing each Month object with information specific to it. You will solve this problem with the constructor of the Year class, explained below.
Day of the week that the years begins on; i.e., a Monday, a Tuesday, etc.
The Year class must also provide the following functionality:

The constructor must store the day of the week that the year begins with, and then it initializes all 12 Month objects in the array.
The Year class will print a calendar for the entire year by calling the print method for each Month object in the array.
NOTE: You must name your source files as follows:

Month.h
Month.cpp
Year.h
Year.cpp
main.cpp


In main(), you must instantiate a Year object and then call its print method.
The output should be a complete calendar as follows:


January

Mon Tue Wed Thu Fri Sat Sun

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

Mon Tue Wed Thu Fri Sat Sun

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

Mon Tue Wed Thu Fri Sat Sun

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

Mon Tue Wed Thu Fri Sat Sun

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

Mon Tue Wed Thu Fri Sat Sun

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

Mon Tue Wed Thu Fri Sat Sun

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

Mon Tue Wed Thu Fri Sat Sun

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

Mon Tue Wed Thu Fri Sat Sun

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

Mon Tue Wed Thu Fri Sat Sun

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

Mon Tue Wed Thu Fri Sat Sun

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

Mon Tue Wed Thu Fri Sat Sun

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

Mon Tue Wed Thu Fri Sat Sun

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

My month header file

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
#include<iostream>
#include<string>
using namespace std;

class Month
{
private:
	int daysInMonth;
	string month;
	int dayMonthStarts;
	string monthCode;
public:
	static const int January= 1;
	static const int February= 2;
	static const int March= 3;
	static const int April= 4;
	static const int May= 5;
	static const int June= 6;
	static const int July= 7;
	static const int August= 8;
	static const int September= 9;
	static const int October= 10;
	static const int November= 11;
	static const int December= 12;

	static const int Mon= 1;
	static const int Tue= 2;
	static const int Wed= 3;
	static const int Thu= 4;
	static const int Fri= 5;
	static const int Sat= 6;
	static const int Sun= 7;

	void setDaysInMonth(int new_daysInMonth);
	void setMonth(string new_month);
	void setDayMonthStarts(int new_dayMonthStarts);
	void setMonthCode(string new_monthCode);
	int daysInMonth( int m);
	int createMonth( int new_month, int day);
	int dayMonthStarts( int new_dayMonthStarts);
};


My month cpp file

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
#include<iostream>
#include<string>
#include"Month.h"
using namespace std;

int Month::createMonth(int new_month, int d)
{
	if(new_month == 1)
	{
		setMonth("January");
		setDaysInMonth(daysInMonth(1));
		setDayMonthStarts(d);
	}
	else if(new_month == 2)
	{
		setMonth("February");
		setDaysInMonth(daysInMonth(2));
		setDayMonthStarts(d);
	}
	else if(new_month == 3)
	{
		setMonth("March");
		setDaysInMonth(daysInMonth(3));
		setDayMonthStarts(d);
	}
	else if(new_month == 4)
	{
		setMonth("April");
		setDaysInMonth(daysInMonth(4));
		setDayMonthStarts(d);
	}
	else if(new_month == 5)
	{
		setMonth("May");
		setDaysInMonth(daysInMonth(5));
		setDayMonthStarts(d);
	}
	else if(new_month == 6)
	{
		setMonth("June");
		setDaysInMonth(daysInMonth(6));
	}
	else if(new_month == 7)
	{
		setMonth("July");
		setDaysInMonth(daysInMonth(7));
		setDayMonthStarts(d);
	}
	else if(new_month == 8)
	{
		setMonth("August");
		setDaysInMonth(daysInMonth(8));
	}
	else if(new_month == 9)
	{
		setMonth("September");
		setDaysInMonth(daysInMonth(9));
	}
	else if(new_month == 10)
	{
		setMonth("October");
		setDaysInMonth(daysInMonth(10));
		setDayMonthStarts(d);
	}
	else if(new_month == 11)
	{
		setMonth("November");
		setDaysInMonth(daysInMonth(11));
		setDayMonthStarts(d);
	}
	else if(new_month == 12)
	{
		setMonth("December");
		setDaysInMonth(daysInMonth(12));
		setDayMonthStarts(d);
	}
}

int Month::daysInMonth(int m)
{
	if( m == 1)
	{
		return 31;
	}
	else if( m == 2)
	{
		return 28;
	}
	else if( m == 3)
	{
		return 31;
	}
	else if( m == 4)
	{
		return 30;
	}
	else if( m == 5)
	{
		return 31;
	}
	else if( m == 6)
	{
		return 30;
	}
	else if( m == 7)
	{
		return 31;
	}
	else if( m == 8)
	{
		return 31;
	}
	else if( m == 9)
	{
		return 30;
	}
	else if( m == 10)
	{
		return 31;
	}
	else if( m == 11)
	{
		return 30;
	}
	else if( m == 12)
	{
		return 31;
	}
}
	int Month::dayMonthStarts(int new_dayMonthStarts)
	{
		if(new_dayMonthStarts == 1)
		{

		}
	}

}


Please help! Thanks.
Topic archived. No new replies allowed.