I can’t get winter to display unless I put it as :
If (month==12)
System.out.println(“winter”);
But then it still tells me it’s wrong, when I do the comparisons (as shown) it prints the other three, not winter....what did I do.
package com.codegym.task.task04.task0411;
/*
Seasons on Terra
*/
public class Solution {
public static void main(String[] args) {
checkSeason(12);
checkSeason(4);
checkSeason(7);
checkSeason(10);
}
public static void checkSeason(int month) {
//write your code here
if (month>11 && month<=2)
System.out.println("winter");
if (month>=3 && month<=5)
System.out.println("spring");
if (month >5 && month<=8)
System.out.println("summer");
if (month>=9 && month<=11)
System.out.println("autumn");
}
}