Need to return both inNorthernHem and ! in NorthernHem
returning the season is simple enough but I haveno idea how to return what the season is not (!)
month_______inNorthernHemisphere_______! inNorthernHemisphere
12, 1, or 2____"Winter"__________________"Summer"
3, 4, or 5_____"Spring"__________________"Fall"
6, 7, or 8_____"Summer"________________"Winter"
9, 10, 11_____"Fall"____________________ "Spring"
Here is what I have so far
CODE
public static String season(int month, boolean inNorthernHemisphere){
if (month > 12){
return null;}
if (month < 1){
return null;}
if (month ==12){
return "Winter";}
if (month <=2){
return "Winter";}
if (month >= 3 || 5 >= month){
return "Spring";}
if (month >= 6 || 8<= month){
return "Summer";}
if (month >= 9 || 11 >= month){
return "Fall";}
}
Also I keep getting an error that this must return a string, not sure once I get the boolean ! inNorthernHemisphere if that will be resolved or something else needs to be changed
Any help would be great, thank you!
This post has been edited by anorman: 5 Feb, 2008 - 07:59 PM