Hello there
I have a question about the return statement... I'm not getting anything when I run my code. I should get answers like Winter, Fall, Spring, Summer but my return is not working?
Thanks for the help.
Here is my code:
Code:
public static void main (String[] args){
season(11, 15);
}
public static String season(int month, int day){
String result = "";
if((month == 12 && day >=16) || (month <= 3 && day <=15))
result += "Winter";
else if ((month >=9 && day >=16) || (month <=12 && day <=15))
result += "Fall";
else if ((month >=6 && day >=16) || (month <=9 && day <=15))
result += "Summer";
else if ((month >=3 && day >=16) || (month <=6 && day <=15))
result += "Spring";
return result;
}
}