Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

2 Dimensional Arrays / Loop problem....

 
Wolfgang Obi
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi im trying to make a simple calender, i'm having a little difficulty:



this is my output:

Please enter the year and month of your choice.

Your year please: 2006

Your month please: 2

these are ur days 28

-------------------------------
Feb.
_______________________________

Mon. 1 2 3 4 5 6 7
Tue. 7 8 9 10 11 12 13
Wed. 13 14 15 16 17 18 19
Thu. 19 20 21 22 23 24 25
Fri. 25 26 27 28 29 30 31
Sat. 31 32 33 34 35 36 37
Sun. 37 38 39 40 41 42 43


-How do i rearrange the days?
-How do i get the days arranged chronologically so they tally with the actual gregorian calendar?
-Why do i have more days in the month than were returned?

could it be that my loops are faulty?

I'd really appreciate some help, thanx!
[ June 13, 2006: Message edited by: Wolfgang Obi ]
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's look at your code, my comments start with ***



Basically the code above winds up doing this:

So you are printing 7 days 7 times, for a total of 49 days with 6 duplicates. I doubt this is what you wanted.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic