This is the assigment. I believe I am only allowed to use If and else statements
> The following algorith yields the season (Spring, Summer, Fall, or
> Winter) for a given month of the day.
> IF month is 1,2, or 3, season = "Winter
> Else if month is 4, 5, or 6, season = "Spring"
> Else if month is 7,8, 9, season = "Summer"
> Else if month is 10,11, or 12, season = "Fall"
> If month is divisible by 3 and day >= 21
> If season is "Winter", season = "Summer"
> Else if season is "Spring", season = "Spring"
> Else if season is "Summer", season = "Fall"
> Else season = "Winter"
> Write a program that prompts the user for a month and day and then
> prints the season, as determined by this algorithm
Heres what I got so far. I can't get the last part to get the seasons to change if the month is divisible by 3 and day is above 20.
It seems you're almost finished with this. You just have to remove the System.out.println statements on lines 18, 22, 28 and 33 and print the value of the variable season at the end of the program instead (after line 53). Right now you are printing the value before the last part (lines 37-52) has executed, so obviously you don't see the result of the logic in that last part.
It also looks like you forgot something at line 39, there's an empty if-block there.