|
-
May 21st, 2012, 05:39 AM
#2
Re: Help writing java code
Hi!
First of all, you should avoid to name your class Date. It is not a good coding style naming classes after a java object class.
Next, avoid to use too many nested if and else statements. Instead use switch/case statements wherever you can.
Now to your problem. If I get you right, all you need is to write is a new Java class containing a main method (similiar to the one you already have in your Date class). Read in the user input, call the Date's class constructor with current date as parameters, code a FOR loop and call nextDay method in Date class as often as the user specified.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|