So Using this method :
I'm supposed to display all the days from January 1 - December 31 (so it should look like January 1, January 2, January 3, etc. etc. on a separate line) until it reaches December 31st. However, with the code i have written thus far, I can only get it to display the last day of each month of a particular year (I happened to choose 2016. I'm very disappointed with my problem solving skills thus far. I thought that this would be a walk in the park, but I'm struggling and it's infuriating me. Surely, I shouldn't be having this much difficulty with using premade methods and implementing them into the main class. In any case, here's my code. Please help me dissect what's wrong with how I'm approaching the problem.
The method is not my method. But I"m supposed to utilize it to do the aforementioned. Thanks!
Paweł Baczyński wrote:Make a method that displays all days in a single month (takes number of the month and a year as parameters).
Inside the method loop from 1 to whatever countDays returned.
Isn't that what the countDay's method kind of does. Its parameters are month and year. There are cases for each month.
Paweł Baczyński wrote:This method only returns how many days a month has. You need to write printing logic yourself.
Oh ok got it, thanks! I hate how I'm so bad at Java right now. I seem to be having trouble being good at for loops and understanding that i need to edit the method. Please tell me that it gets better.