Im a newbie in java and i need help. im a student

im an I.T student in Adamson University here in the philippines i went here to ask help about our activity in school about java. our professor told us to make a program in java (btw were using netbeans) that will ask the user his birth year and then the output will tell the zodiac sign of the year entered. she told us (our prof) to make it using showInputDialog. and then to show the output we must use the JOptionPane.showMessageDialog.
i try to do it but i found myself in trouble bcoz im new in java.
i try to to it and here's what i did
import javax.swing.JOptionPane;
public class Zodiac;
public static void main(String args[])
String name=JOptionPane.showInputDialog("Enter your year of birth?");
String message=String.format("Your zodiac sign is tiger");
JOptionPane.showMessageDialog(null,message);
i knew that i need to use conditional statements here but i dont know where to put it and how to declare the JOptionPane.etc.
pls help me asap im a newbie.

as you wish heres what i did. this is not a gui version
* To change this template, choose Tools | Templates
* and open the template in the editor.
package marlonestipona;
* @author ESTIPONA
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int yr1;
String tgr ="Tiger";
String dog ="Dog";
String rbt ="Rabbit";
String ox ="Ox";
String drgn ="Dragon";
String rat ="Rat";
String pig ="Pig";
String rst ="Rooster";
String hrs ="Horse";
String shp ="Sheep";
String mky ="Monkey";
String snk ="Snake";
System.out.print("Enter your birth year: ");
yr1=input.nextInt();
if (yr1==1974 || yr1==1986 || yr1==1998)
System.out.printf("Your zodiac sign is %s!\n",tgr);
}else if (yr1==1982 || yr1==1994 || yr1==2006){
System.out.printf("Your zodiac sign is %s!\n",dog);
}else if (yr1==1975 || yr1==1987 || yr1==1999){
System.out.printf("Your zodiac sign is %s!\n",rbt);
}else if (yr1==1973 || yr1==1985 || yr1==1997){
System.out.printf("Your zodiac sign is %s!\n",ox);
}else if (yr1==1976 || yr1==1988 || yr1==2000){
System.out.printf("Your zodiac sign is %s!\n",drgn);
}else if (yr1==1972 || yr1==1984 || yr1==1996){
System.out.printf("Your zodiac sign is %s!\n",rat);
}else if (yr1==1983 || yr1==1995 || yr1==2007){
System.out.printf("Your zodiac sign is %s!\n",pig);
}else if (yr1==1981 || yr1==1993 || yr1==2005){
System.out.printf("Your zodiac sign is %s!\n",rst);
}else if (yr1==1978 || yr1==1990 || yr1==2000){
System.out.printf("Your zodiac sign is %s!\n",hrs);
}else if (yr1==1971 || yr1==1991 || yr1==2003){
System.out.printf("Your zodiac sign is %s!\n",shp);
}else if (yr1==1980 || yr1==1992 || yr1==2004){
System.out.printf("Your zodiac sign is %s!\n",mky);
}else if (yr1==1977 || yr1==1989 || yr1==2001){
System.out.printf("Your zodiac sign is %s!\n",snk);
} else
System.out.println("Invalid");
now my problem is how to turn this whole code into gui using those dialog boxes.

Similar Messages

  • When I try to install iTunes 10.5, it says, "There is a problem with this Windows Installer package.  A program run as part of the setup did not finish as expected.  Contact your support personnel or package vendor."  I have Windows XP and I need help.

    5, it says, "There is a problem with this Windows Installer package.  A program run as part of the setup did not finish as expected.  Contact your support personnel or package vendor."  I have Windows XP and I need help.

    After reading all these posts, one by one did not resolve my problem until I got the very end.  Regardless of what step would resolve your problem, these are the steps I would recomment to everyone for a what seems to be a safe and fool-proof upgrade to iTunes 10.5.
    1. Stand alone upgrade to the latest Quicktime version
    2. Go to control panel and "change" then select repair to the following applications in the order specified by the post on Oct 27. (Notice I skipped Quicktime because it had been upgrade manually,and Bonjour did not have a "repair" option)
    iTunes; Apple Software Update: Mobile Device Support; Apple Applications Support
    Some of these applications may not appear if they do not apply to your configuration (no iPhone, or no iPad, or other apple devices).
    Once all updated, I did not need to restart nor launch any applications, I simply went straight into the 10.5 upgrade, and where it normally got stuck, this time the installation continued for a while longer until it completed successfully.
    Great work everyone who contributed!  Thank you very much!

  • My daughters IPod was stolen and I need help trying to locate it?

    And I dont know how to do this and really need help

    - If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone. If the iPod has been restored it will never show up.
    - You can also wipe/erase the iPod and have the iPod play a sound via iCloud.
    - If not shown, then you will have to use the old fashioned way, like if you lost a wallet or purse.
    - Change the passwords for all accounts used on the iPod and report to police
    - There is no way to prevent someone from restoring the iPod (it erases it) using it.
    - Apple will do nothing without a court order                         
    Reporting a lost or stolen Apple product                                        
    - iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number

  • I'm new to SQL Server Integration Services and I need help on how to begin learning SSIS. Is there any training for it besides msdn?

    I'm new to SQL Server Integration Services and I need help on how to begin learning SSIS. Is there any training for it besides msdn?

    Check this thread where people have already given their suggestion on learning SSIS
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/f2cc1cf3-204d-454a-a189-47df87a3aa23/i-want-to-learn-ssis?forum=sqlintegrationservices
    I would suggest to go for You tube videos (type learn SSIS or begin SSIS step by step) you will get lot of good tutorials to start with.
    Happy Learning!!
    If this post answers your query, please click "Mark As Answer" or "Vote as Helpful".

  • In testing 9 and X, "Compare Docs" we have a critical issue and really need help!

    For years we have used Acrobat 7 to do PDF compares and we love it!  However, the company recently advised we must upgrade to 9 and then eventually to X.  In testing 9 and X, Compare Docs we have a critical issue and really need help.  Our PDFs are produced by IT in a batch process and one of our main, critical functions is to compare previous PDFs to current PDFs;  however, in using 9 the Compare screen automatically sets the Doc Description for our PDFs to "Scanned Doc" and does not produce any differences! If you try to change the setting to Reports --it totally shuts down both documents without running!  Version 7 runs the compare of the same PDFs  beautifully, pointing out all the differences, as usual!  Has this every happen to anyone?  Do you know what we can do to our PDFs to allow version 9 to do the compare and produce results?  Why is 9 treating these non-scanned PDF docs as such?  Thanks so much for any help or insight you can give me on this issue! 

    (Moved the discussion to the correct forum)

  • I have a PC and a need help to configure my external hard disk on my network. Thanks

    I have a PC and a need help to configure my external hard disk on my network. Thanks

    If you mean you wish to plug a USB drive into the Airport Extreme router (or TC not express) that is easy..
    The disk must be formatted FAT32.. as if.. stay away from FAT .. or HFS+ ie Mac OS extended Journaled.
    Format the disk on a Mac is best.. and even use GUID partition scheme not MBR.
    The PC has no issue writing and reading files because this is a network drive.. The PC does not write to the drive.. it writes files to the Airport OS which writes and reads the disk and passes the info using standard windows SMB.. To the windows computer it will be a Windows NT server.. FAT32 setup.
    If your setup is different.. to my hugely guessed assumptions.. give details.. always helps to have.. make and model.
    Make and model of disk.. make and model of router.. how the setup will be done.. what windows OS you run.. etc etc.
    As it stands your question could have nothing to do with apple at all.. other than you posted in a forum so I guess there is something apple in there somewhere.

  • I'm trying to reinstall Logic Pro 9, and it says It's already installed. I have a project due for class and I need help asap. Please help!!!

    I'm trying to reinstall Logic Pro 9, and it says It's already installed. I have a project due for class and I need help asap. Please help!!!

    Yea I am. I deleted Logic Pro 9 and moved the App to the Trashcan like normal. Then when I go to install it, it says its already Installed. When I do this with other apps; it works fine, the install thing comes back up like it should once you have deleted the app

  • My old iMac and OS 10.4 will not accept the New iTunes Version 10 application and I can't get past the screen offering to download iTunes 10.  This is wrong and I need help getting past this situation. Help!

    My old iMac and OS 10.4 will not accept the New iTunes Version 10 application and I can't get past the screen offering to download iTunes 10.  This is wrong and I need help getting past this situation. Help!

    Sure, you can get around it if you don't need the newest version of iTunes. I still use version 7.5 because the newer versions didn't strike me as offering anything I needed.
    If you do need a version 10-something then you will have to upgrade your operating system to Leopard (fi your computer will support it) at least.  If you need 10.5 for some reason then there's no getting around it, you will have to buy a new computer.

  • This morning i tried to restore my ipod and it said:"the ipod "ipod cannot be restored at this time because the ipod software update server could not be contacted or is temporarily unavalible." i have no idea what to do and i need help

    this morning i tried to restore my ipod and it said:"the ipod "ipod cannot be restored at this time because the ipod software update server could not be contacted or is temporarily unavalible." i have no idea what to do and i need help.

    Update Server
    Try:
    - Powering off and then back on your router.
    - iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
    - Change the DNS to either Google's or Open DNS servers
    Public DNS — Google Developers
    OpenDNS IP Addresses
    - For one user uninstalling/reinstalling iTunes resolved the problem
    - Try on another computer/network
    - Wait if it is an Apple problem

  • My grandma is a new apple user and she needs help making an apple account.

    my grandma is a new apple user and she needs help making an apple account.

    She should call Apple support or visit the Genius Bar at an Apple store (make an appointment first at http://apple.com/retail). They will walk her through the process.

  • I am john and I need help downloading a progmmme yesterday and wanted to finish downloading open it and I am not told me that the program was shut down unexpectedly and restart ponia not opened and went back to download it and not opened my back probe to

    i am john and I need help downloading a progmmme yesterday and wanted to finish downloading open it and I am not told me that the program was shut down unexpectedly and restart ponia not opened and went back to download it and not opened my back probe to turn off the computer and there was no case

    i am john and I need your help yesterday bought a program called DJAY when I finish the download and got an error opened and I saw him there was no case to install and thank you for your help anyway

  • I want officially unlock my phone second bought in senegal since more than three months but after buying it i realize it is locking by orange france and i need help

    hello want help without paying money cause now i'm in senegal and not sure to transfer money     
    i want to officially unlock my iphone 4 second hand bought here in senegal in west africa since more than 3 months but after this i realize that it is simlocked to oarange france so i cannot use it and i need help near apple to begin use legaly my iphone thanx

    You will need to contact Orange France. They are the only ones who can officially unlock a phone locked to their network.

  • I'm new to java and I need some quick help with NetBeans.

    Hi. To whomever can help here's the problem. I've been trying to install netbeans ide 5.0 on my computer for a while now and i can't seem to find out what is wrong. I'm in a java programming course and i need the J2SE Developement Kit 5.0 Update 7 and NetBeans IDE 5.0 Installer on my comp. Whenever i go to install it, it can't automatically create a directory and has erroe null in place of it. Whenever i made a new directory for it a page would come up telling me all of the errors during the installation which are null. Since i have administrator privelages and plenty of free space on my hardrive.

    Hi,
    I want to suggest you that
    1.please check if any prerequisite is require before installing the NetBeans IDE,i hope there is nothing like that except proper jdk on your machine.
    2.if you already having JDK on your machine check for the compatibility of that jdk version with the required NetBeans IDE version.
    3.follow the steps provided to install the NetBeans IDE 5.0 for that refer the below link
    http://www.netbeans.org/community/releases/50/install.html
    hope you will get rid of the problem .....
    ---Vidya

  • Help - I'm a newbie to Mac and still need my Internet Explorer browser!

    macbook pro   Mac OS X (10.4.8)   Hi - I just purchased a macbook pro and am in the process of designing a website - after encountering problem after problem, the hosting company figured out that I'm using a Mac, and said that their program doesn't support Safari and I need to do my design through an Explorer browser. Microsoft discontinued Explorer for Mac, so what do I do? I heard of a program called Parallels Desktop - has anyone used it, will it work, or am I opening up Pandora's box by installing it on my computer? Changing hosting companies is not an option, so I need to make this work. THANKS!!!!!
    macbook pro   Mac OS X (10.4.8)  
    macbook pro   Mac OS X (10.4.8)  

    You're trying to use a web-site building application that doesn't support Macs? I personally would not deal with any hosting company that won't support anything beyond Windows. Whatever you build with this company will not be accessible to other Macs. But this is your prerogative.
    You're correct that Internet Explorer for Mac has been discontinued and it was discontinued at version 5.2x. To run IE for Windows on your Mac you'll need something like Apple's Boot Camp <http://www.apple.com/bootcamp/>, Parallels from <http://www.parallels.com/> or if you're feeling adventurous you can try the CrossOver beta from <http://www.codeweavers.com/>, which will let you run Windows applications without Windows.
    Are you opening a Pandora's Box? I don't think so. You do need to take the same precautions you would with a regular Windows machine. That means installing antivirus software and spyware software. Be sure to test your website with both your Mac browsers as well as IE for Windows.
    Hope this helps! bill
    1 GHz Powerbook G4   Mac OS X (10.4.8)  

  • Help, I am killing myself trying to do this and I need help ASAP

    I need help with this program it has to act like a cash register. The user will input an items price and then their payment. It will tell you the change and then tell you what kinda of change to use, see example below:
    Use JOptionPane to take inputs from the user and display the results.
    Example:
    If the user enters
    Amount Due = 5.52 // First Input from the User
    Amount Given = 10.00 // Second Input from the User
    Calculate the Balance Due
    Balance Amount = $ 4.48
    and display the balance due in denomination as (The following four lines will be ONE Output to the user)
    $1 bill = 4 (4.00)
    Quarters = 1 (0.25)
    Dimes = 2 (0.20)
    Pennies = 3 (0.03)
    This last part, where you display the change that will be given back, ie: how many quarters, dimes, nickels, pennies is the part I am having problems with.
    Can some one help? Please pardon my coding abilities, I am still learning how to do this and would really appreciate any help you can with my program.
    Thanks in advance.
    import javax.swing.*;
    import java.text.*;
    public class CashReg
    { //Start
    public static void main (String [] args)
    { //Start Main
    int count = 0;
    char c1 = 0;
    String price = null;
    String payment = null;
    String change = null;
    boolean correct = false;
    while(!correct)
    { //Start Loop
    price = JOptionPane.showInputDialog (null,"Enter the amount of the item for purchase");
    if (price.length() < 1) //Loop
    JOptionPane.showMessageDialog (null, "You did not enter a purchase amount, try again please.");//Error message
    payment = JOptionPane.showInputDialog (null,"Enter your payment amount.");
    if (payment.length() < 1) //Loop
    JOptionPane.showMessageDialog (null, "You did not enter a payment amount, try again please.");//Error message
    else
    correct = true; //Boolean to confirm that there are enough characters
    for (int i=0; i<price.length(); i++)
    if (Character.isUpperCase(price.charAt(i)))
    count++;
    } //End loop
    // response = price - payment;
    JOptionPane.showMessageDialog (null, "You item costs "+price+" and you payed "+payment+" and your change will be "+change);
    System.exit(0);
    } //End Main
    } //End

    OK, thanks for your help, but I need some more. I have the program running and showing the amount of change that is going to be returned. But I don't know how to display the kind of change. AKA, quarters, dimes, nickels and pennies. I am a programming idot, my teacher is letting us twist in the wind. He is not explaining the concepts behind any of this. You are saying the word "logic" and I don't know what that means. This assigment is due Monday, I just need some help with the last part. How to show the change. I am just plain lost. please help.
    import java.text.DecimalFormat;
    import javax.swing.*;
    import java.text.*;
    public class CashReg
    {     //Start
         public static void main (String [] args)
         {          //Start Main
              int count = 0;
              char c1 = 0;
              String price = null;
              String payment = null;
              String change = null;
              boolean correct = false;
         while(!correct)
         {          //Start Loop
         price = JOptionPane.showInputDialog (null,"Enter the amount of the item for purchase");
              if (price.length() < 1)     //Loop
                   JOptionPane.showMessageDialog (null, "You did not enter a purchase amount, try again please.");//Error message
                   payment = JOptionPane.showInputDialog (null,"Enter your payment amount.");
              if (payment.length() < 1)     //Loop
                   JOptionPane.showMessageDialog (null, "You did not enter a payment amount, try again please.");//Error message
              else
                   correct = true; //Boolean to confirm that there are enough characters
    for (int i=0; i<price.length(); i++)
              if (Character.isUpperCase(price.charAt(i)))
              count++;
         }     //End loop
    //     response = price - payment;
    float fPrice = Float.parseFloat(price);
    float fPayment = Float.parseFloat(payment);
    float fChange = fPayment-fPrice;
    DecimalFormat df = new DecimalFormat ("#.00");
    JOptionPane.showMessageDialog (null, "You item costs "+price+" and you payed "+payment+" and your change will be "+ df.format (fChange));
    This is where I don't know what to put
         System.exit(0);
         }     //End Main
         }     //End
    I am begging for help.

Maybe you are looking for

  • Forms 6.0/user_exit call to DLL--Thoughts anyone?

    I have 6.0 Forms that call to DLL functions where the DLL was built using MS VC++ 5.0--works fine. Upgraded to MS VC++ 6.0 and rebuilt DLL (no code changes). Pointed FORMS60_USEREXITS registry to new DLL but now get the following message when trying

  • Problem with purchase cancellation with lenovo/digitalriver

    Hi, So I am from the UK. I ordered an x1 carbon on 18th September, then cancelled the purchase 1 day later on the 19th. I received the following email from the lenovo uk supplier digital river. Dear ....,  Thank you for contacting the Lenovo Online S

  • JMF, OutOfMemory... (Urgent)

    Hello, friends... Now, we are trying to develop media player using JMF. Our MDI application does play a local media file and RTP play with data sources on the network, by using JIntenalFrame. Then, out problem is that, "any player or any processor al

  • MS Excel Tab Naming Convention Issue

    Issue Description :    Summary excel file was confirming the source of workbook before opening the file.(Message : Excel found untraceable content in - Lex-1(Lex-Total) Summary report. Do you want to recover contents of workbook? If you trust the sou

  • Blank slides & missing content from Windows PPT to the mac

    When I open PowerPoint files from the PC on the mac in PowerPoint 2011, there are blank pages/missing content. When I open in PowerPoint 2008 on the mac it's fine. I've removed duplicated fonts, and checked under a different user profile - but it sti