Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where are the dates

 
Alice Stevens
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all:
This board was highly recommended by a couple of folks in my beginning java class so I hope that I am not imposing on you with my questions.
I did a search on the web for calendar projects (like a lot of us did) and I found this one. This code is suppose to print out a calendar for a month and year that's input by a user. The code prints out the month and array of days of the week but it will not print out the dates of the month.
Would someone be able to tell be why the program scrolls down after the days of the week row instead of printing out the dates 1, 2, 3, etc.? How do I get the dates of the month to show up.
Thank you for your patience and assistance.
 
Donald R. Cossitt
buckaroo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will this even compile?
 
Alice Stevens
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It compiles without any problems but when I run the code I get:
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code is NOT compiling...
Where is the class 'SavitchIn'?
Rene
 
Alice Stevens
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My apologies - the Savitch Class is a Class that came with the CD in the book we're using. Here is the Savitch class:
 
Donald R. Cossitt
buckaroo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
File won't compile

I am not real familiar with the symbol pointed to by the JVM. What package is this imported from? Other than that it is difficult to tell where some of your if/else & for structs end and begin as there are few to no curly braces. The total lack of indentation at those junctures makes it equally difficult to see what you are doing.
Check this out.
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this block of code near the end:

I'm not sure because I haven't tried running it, but it seems to me that if you'd replace the second System.out.println() with something like:

... then you might get the correct output.
 
Alice Stevens
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh my - there goes those dates. It's amazing what the difference a few lines of coding can do.

Thank you!
[ April 25, 2003: Message edited by: Alice Stevens ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic