Created
November 6, 2018 15:15
-
-
Save DonatasD/a118e1338e08822a858cb2cb7829b67a to your computer and use it in GitHub Desktop.
This file contains 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
import java.util.Scanner; | |
public class Example { | |
public static void main(String[] args) { | |
Scanner reader = new Scanner(System.in); | |
System.out.println("Enter a month: "); | |
int month = reader.nextInt(); | |
System.out.println("Enter a day: "); | |
int day = reader.nextInt(); | |
reader.close(); | |
System.out.println(findHoroscope(month, day)); | |
} | |
private static String findHoroscope(int month, int day) { | |
if (month == 2 && day >= 20 && day <= 31 || month == 3 && day >= 1 && day <=20) { | |
return "Pisces"; | |
} | |
return "Not available"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment