Created
September 16, 2015 15:09
-
-
Save AnnaBoro/0222f0f759c2c29028c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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