I must create a program in which the output would show the season accroding to these ranges:
- 12/16-3/15 is winter
- 3/16-6/15 is spring
- 6/16-9/15 is summer
- 9/16-12/15 is fall
Here is my code thus far:
public class season1 {
public static void main(String[] args) {
System.out.println("Between 12/16 and 3/15 is " + season());
System.out.println("Between 3/16 and 6/15 is " + season());
System.out.println("Between 6/16 and 9/15 is " + season());
System.out.println("Between 9/16 and 12/15 is " + season());
}
public static int season(int a, int b){
if (x=12 a <= 16 && b >= 15) (x=3 b>=15)){
return "winter";
}
else if (
if (x=3 a <=16 && b>=15) (x=6 b>=15)){
return "spring";
}
if (x=6 a <=16 && b>=15) (x=9 b>=15)){
return "summer";
}
if (x=9 a <=16 && b>=15) (x=12 b>=15)){
return "fall";
}
}
}