aspose file tools*
The moose likes Beginning Java and the fly likes 2 Dimensional Arrays / Loop problem.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "2 Dimensional Arrays / Loop problem...." Watch "2 Dimensional Arrays / Loop problem...." New topic
Author

2 Dimensional Arrays / Loop problem....

Wolfgang Obi
Ranch Hand

Joined: Dec 05, 2005
Posts: 134
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

Joined: Dec 13, 2004
Posts: 429
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.
 
 
subject: 2 Dimensional Arrays / Loop problem....