
-----------------------------------
jsnnyj
Wed Mar 15, 2006 12:21 pm

Making a calendar program?
-----------------------------------
Hi, right now I need to make a program that you have to input the day that the first date of a month falls upon ( for example, Tuesday, Friday,etc) and then outputs the days of the month and the corresponding days.

I thought this would be easy but now I'm stuck. I have a date[] array of 31 elements, but how can I don't quite get how to assign the days for the dates, because it doesn't have to start from 1 to 7.

Any help is greatly appreciated, thx!

-----------------------------------
Justin_
Wed Mar 15, 2006 2:01 pm


-----------------------------------
Does this program have to address there are varying amounts of days in each month?  

Try making a class to include information for each day, like name of day and number, then make an array of them.  Then find an efficient way to initialize them with all the information.  Then design a method you can call in a loop for all the objects in the array that will say what their information is.

-----------------------------------
jsnnyj
Wed Mar 15, 2006 2:30 pm


-----------------------------------
Does this program have to address there are varying amounts of days in each month?  

Try making a class to include information for each day, like name of day and number, then make an array of them.  Then find an efficient way to initialize them with all the information.  Then design a method you can call in a loop for all the objects in the array that will say what their information is.

No, it should assume that the month has 31 days. The parts I don't get is how to initialize it and output the information.

-----------------------------------
Justin_
Wed Mar 15, 2006 2:45 pm


-----------------------------------
if it is always 31 days than you could make a day array that holds all the days of the week. (monday, tues etc..) then make an array of 31 Days.  Day being the name of your class.  Then make its day and number private, make a method called editDay(string day) and make the method set day to whatever day is.  Same sort of thing for number.  

Then to initialize it, in your main function you'd write 

for (int i ; i 