posted 9 years ago
1. You have got only 1 method in your class, and that method is named "main" which suppose to start your program only.
And it should look similar to:
2. Check if leap year suppose to become a method named isLeapYear() and return "true" if it is, and "false" if it is not.
3. Define month suppose to be a separate method also, which a singular task to define which month it is. Could be named for ex. "defineMonthName()"
4. Define the day of the month should be method also, and take a month name as a parameter.
And likely more methods. So, after you get methods created, your program could be similar to:
After all this, you might find that you can simplify some parts. If you write program by placing all code in one method, it is very difficult to improve something without breaking down something.
Also, it is very difficult to follow your program flow. For the simple programs one class maybe is enough, but one method is not enough in pretty much all cases. Unless it is a "Hello, World" program.