
Hello Guys!! Plz. Help
I need to write a program to display the astrological sign based on your birthday for example If we enter the date of birth in the following format from console--13/08/1990 it should give you the output as ?LEO"

Hi Friend,
Try this:
import java.util.*;
public class ZodiacSign{
public static void main(String[] args) {
String sign="";
Scanner input = new Scanner (System.in);
System.out.println("Enter date of birth: ");
String date=input.next();
String arr[]=date.split("/");
int day=Integer.parseInt(arr[0]);
int month=Integer.parseInt(arr[1]);
int year=Integer.parseInt(arr[2]);
if((month == 1) && (day <= 20) || (month == 12) && (day >= 22)) {
sign ="Capricorn";
}
else if((month == 1) || (month == 2) && (day <= 19)) {
sign ="Aquarius";
}
else if((month == 2) || (month == 3) && (day <= 20)) {
sign ="Pisces";
}
else if((month == 3) || (month == 4) && (day <= 19)) {
sign ="Aries";
}
else if((month == 4) || (month == 5) && (day <= 21)) {
sign ="Taurus";
}
else if((month == 5) || (month == 6) && (day <= 21)) {
sign ="Gemini";
}
else if((month == 6) || (month == 7) && (day <= 23)) {
sign ="Cancer";
}
else if((month == 7) || (month == 8) && (day <= 23)) {
sign ="Leo";
}
else if((month == 8) || (month == 9) && (day <= 23)) {
sign ="Virgo";
}
else if((month == 9) || (month == 10) && (day <= 23)) {
sign ="Libra";
}
else if((month == 10) || (month == 11) && (day <= 22)){
sign ="Scorpio";
}
else if(month == 12){
sign ="Sagittarius";
}
System.out.println("Your Zodiac sign is "+sign+".");
}
}
Thanks

Hey thanks frnd!
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.