Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


Rishabh
Plz Help
2 Answer(s)      3 years and 5 months ago
Posted in : Java Beginners


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"


Advertisement
View Answers

February 1, 2011 at 5:57 PM


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



February 1, 2011 at 9:43 PM


Hey thanks frnd!



Related Tutorials/Questions & Answers:
Plz Help
Plz Help  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
plz help
plz help  what is the procedure and code to design an interactive GUI in java using swings
Advertisements
Help me quickly plz??
Help me quickly plz??  Can you help me to write code quickly this code is a java code take input as double and should use command line arguments and enhanced for statement then find the combine of the numbers plz help quickly
plz help me for this question
plz help me for this question  Apply simplex procedure to solve the L.P.P. maximize z = 3x1 + 4x2 subject to 5x1 + 4x2 ? 200; 3x1 + 5x2 ? 150; 5x1 + 4x2 ? 100; 8x1 + 4x2 ?? 80, x1 ? 0, x2 ? 0
java coding help plz ?
java coding help plz ?  Given two integers N and M (N â?¤ M), output all the prime numbers between N and M inclusive, one per line. N and M will be positive integers less than or equal to 1,000,000,000. The difference
Gui plz help
Gui plz help   Create a Java application that would allow a person to practice math (either addition, subtraction, multiplication or division). The questions must be randomly generated ( the values for each number should
Plz Help Me
Plz Help Me  Write a program for traffic light tool to manage time giving between Main-Street and sub-Street. firstly, give green light for 40... traffic light on the frame. We have used java swing. It may help you. import
plz help - Java Beginners
plz help  i have to programs and it takes too long to run them so i got a solution that makes programs run much faster which is threading programming.. but i dont know how to aplly that on my 2 programs: the first code
plz help me find a program
plz help me find a program  plz help..i want a source code in jsp for order processing
plz help me - Java Beginners
plz help me  Deepak I can write a sessioon code plz help me admin_home.jsp page is display but data is not disply plz help me what is wrong
plz help me - Java Beginners
plz help me  Hi, I want to search all field from database using name, and display in text box, then data is update and delete. i want to search name using alphabets a-z, plz reply fast. plz help me this is very urgent
plz help meto solve this question
plz help meto solve this question  for a file that exist what will be the length() method in the file class return
plz Help me - Java Beginners
plz Help me  Hi, I want learn struts,I dont have any idea about this plz help how can i make a framework.If u have any information then plz send my personal id plz tell me that whose software installed.and give me brief
plz help me today plz plz - Java Interview Questions
plz help me today plz plz  2.) Suppose list is an array of six elements of type int. What is stored in list after the following java code executes? . for (i = 0; i < 5; i++) { list[i] = 2 * i + 5
plz help me - Java Beginners
plz help me  deepak hw can i create a data grid in jsp and also how can i connect to the data base plz help me  to create data grid in jsp use html tables with borders. to connect to data base use scriptlets. ex
plz help me - Java Beginners
plz help me  Thanks deepak continue response..i face some problem i hv a these file index.jsp,sessionvalid.jsp, both r store in project folder... is true...but i very confuse that how it is not displayed admin page plz any one
plz help me!!!!!!!! - JSP-Servlet
plz help me!!!!!!!!  i`ve set the environment varaibles for tomcat as well as jdk.. but i`m not understanding where i`ve to save my servlet..i.e.... there are compilation errors.. plz do help me.   make sure that you did
help plz - Java Interview Questions
, if the input string is abcd, the output is : edcba plz plz plz plz plz help...help plz  1 )write a program that does the following : a. prompts the user to input five decimal numbers representing the scores? b. prints
i need help plz .... Quickly
i need help plz .... Quickly   how can i count how many numbers enterd by the user so the output would be like this Total number of Scores = .... this is my code :- import java.util.Scanner; public class SCORES { public
help plz - Java Interview Questions
help plz   1 )write a program that does the following : a. prompts the user to input five decimal numbers representing the scores? b. prints the five decimal numbers? c. converts each decimal number to the nearest integer? d
plz help - Java Interview Questions
plz help  1)write a java program that prompts the user to input a decimal number and print the number rounded to the nearest integer? 2)write aprogram that prompts the user to input the five decimal numbers representing scors
PLZ Need some help JAVA...HELP !!
PLZ Need some help JAVA...HELP !!  Create a class names Purchase Each purchase contains an invoice number, amount of sale and amount of sales tax. Include set methods for the invoice number and sale amount. Within the set
Plz help me in writing the code - Java Beginners
Plz help me in writing the code   Write a two user Chess Game. (users must be on different systems
Plz help me in writing the code - Java Beginners
Plz help me in writing the code   Write a two user Chess Game. (users must be on different systems
Help me plz in Probablity distribution of Java
Help me plz in Probablity distribution of Java  Hello, I have...% is insert or update queries. Which distribution to use and how to achieve it.. Plz help thanks for your time
Intranet Website creation - plz help me
Intranet Website creation - plz help me   hi.. I have assign with the intranet website creation work..right from scratch to end..And honestly I know nothing about it.My domain is totally different .. can anybody pls help me
PLZ HELP ME. i need php code.
PLZ HELP ME. i need php code.   I want php code for bellow OUTPUT. output is just example but it must be letters only. abc bcd efg jku rgt azs hje qqc wws adt
facing problem plz help me out - Framework
Facing problem plz help me out  hi i am new to servlet i deployed... the web.xml file too parallel to the classes folder now i am facing this problem.plz tell me what to do... error:The requested resource (Servlet servlet
help me plz befor 27 februry
help me plz befor 27 februry  what is rung with this ?? help me plzzzz import java.util.Scanner; public class Initials { public static void main (String [] args) { String firstname,lastname
help today plz:( - Java Interview Questions
help today plz:(  write a program that promptes the user to enter the weight of a package in pounds, and then outputs the weight of the backage in to kilograms (one kilogram is approximately, 2.2 pounds)? but i don't use
interview question plz help me and thers
interview question plz help me and thers  A college is good if it satisfies the following conditions: 1.Its number of students is greater than 1000. 2.If the name ends wih a character 'e', then it should not start with character
help me plz - Java Interview Questions
help me plz  1)write a java program that prompts the user to input a decimal number and print the number rounded to the nearest integer? 2)write...? plz answer my question   Hi Friend, Try the following code: 1
Plz help with third Question - Java Beginners
Plz help with third Question  1)- Specify and implement a procedure that determines whether or not a string is a palindrome. (A palindrome reads the same backward and forward; an example is "deed
Plz help me with this Question - Java Beginners
Plz help me with this Question  this is java code ------------------------- Consider the following code: int [ ] a = [1, 2, 3]; Object o ="123"; String t = "12"; String w = t + "3"; Boolean b = o.equals (a); Boolean b2
plz help -java project very urgent
plz help -java project very urgent  ? Ford furniture is a local furniture store in acts, and they as CS graduate students to implement a software system to generate various reports for them at the end of each month. You
help again plz sorry - Java Beginners
help again plz sorry  Thanks for giving me thread code but i have a question this code is comletelly right and i want to make it runs much faster for that i made 5 threads but 2 things i dont understand 1- with one
plz help me - Java Interview Questions
plz help me  1)Rewrite the method in exercise 10 such that it use the binary search algorithm instead. the linear search algorithm is suitable for small arrays or unsorted arrays. for large arrays linear search is inefficient
plz Help me find the correct programs answers
plz Help me find the correct programs answers   Create a washing machine class with methods as switchOn, acceptClothes, acceptDetergent, switchOff... INDICA" and "TATA NANO" respectively. Plz mail me your answers
java, plz help me in doing this - Java Beginners
java, plz help me in doing this  # Write a small record management application for a school. Tasks will be Add Record, Edit Record, Delete Record, List Records. Each Record contains: Name(max 100 char), Age, Notes(No Maximum
Help Me With This Plz - Java Interview Questions
Help Me With This Plz  Write a program that's print a word like(I S E) on the black screen with 0,1 only by using two dimensional array? the 1's will represent the words
PLZ Need some help on the 2nd part of this question...Someone please help !!!!
PLZ Need some help on the 2nd part of this question...Someone please help !!!!  write an application that displays a menue of three items in a restaurant as follows: 1.Cheeseburger 4.99 2.Pepsi 2.00 3.Chips 0.75 prompt the user
need the answer vry urgently..plz help me...[plzzzzzzzz
need the answer vry urgently..plz help me...[plzzzzzzzz  the question... code...hpw to write in eclipse platform....plz plz mail me...to panda.pragnya7@gmail.com/panda_pragnya@yahoo.com...plz plz...help....me..it can change my lyfe
plz help me to write a snake game using swings - Swing AWT
plz help me to write a snake game using swings  write snake game program using swings
help me plz:-Merge multiple jasper files into Single one
help me plz:-Merge multiple jasper files into Single one  how to Merge multiple jasper files into Single one word doc
plz help me to create gui using Java netbeans
plz help me to create gui using Java netbeans  Hi, I am unable to fetch a particular data from DB.I am using netbeans for creating GUI. If I want.... I am unable to fetch the particular data. Plz help me   Hi Friend
very urgent : Iam unable to code this program plz help me - RMI
very urgent : Iam unable to code this program plz help me  Write a Multi-user chat server and client.  Hi friend, Chat server is a standlone application that is made up the combination of two-application, server
plz help me out with this problem...please write the program for me.thanxxxxx
plz help me out with this problem...please write the program for me.thanxxxxx  Write a program that will print out a hydro bill. The bill will be formatted as the example on the next page. The following information
plz help me out with this problem...please write the program for me.thanxxxxx
plz help me out with this problem...please write the program for me.thanxxxxx  Write a program that will print out a hydro bill. The bill will be formatted as the example on the next page. The following information
population problem plz help me befor 16 March 2011 !!
population problem plz help me befor 16 March 2011 !!  the Q is : How can i count how many years it will take for the population of a town to go over 30.000 .. consider that it Increases 10% every year ?? And this is my code &
having problem with menu ans sub menu items css ...plz help!!
having problem with menu ans sub menu items css ...plz help!!  PLZ help ...this is my html menu > <div id="content"> <div >...'); } ); }); </script> ANY help wud be Much Appreciated. Thanks in advance
Advertisements
 

 

 

DMCA.com