Skip to content

Instantly share code, notes, and snippets.

@AnnaBoro
Created September 16, 2015 15:09
Show Gist options
  • Save AnnaBoro/0222f0f759c2c29028c9 to your computer and use it in GitHub Desktop.
Save AnnaBoro/0222f0f759c2c29028c9 to your computer and use it in GitHub Desktop.
package lesson2;
public class Frame23 {
public static void main(String[] args) {
System.out.println(isSpring(-2));
System.out.println(isSpring(2));
System.out.println(isSpring(6));
System.out.println(isSpring(5));
}
static int isSpring(int month) {
if (month == 3 || month == 4 || month == 5){
return 1;
}
if (month <=0 || month > 12){
return -1;
}
return 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment