Results 1 to 4 of 4
  1. #1
    uranis_khai is offline Member
    Join Date
    Jul 2009
    Posts
    1
    Rep Power
    0

    Unhappy Need answer asap!!!

    Hi All,

    I'm a beginner in java. I tried program that i code and compile it, the process of compilition is okay but no output are produced.

    could you all help me with this. Here's the source code that i tried :

    import javax.swing.*;

    public class Test {
    public static void main(String[] args) {
    String ans;
    ans = JOptionPane.showInputDialog(null, "Speed in miles per hour?");
    double mph = Double.parseDouble(ans);
    double kph = 1.621 * mph;
    JOptionPane.showMessageDialog(null, "KPH = " + kph);

    System.exit(0);
    }
    }

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    That looks OK. What does happen when you run it?

    Make sure you are running the same code you are compiling!

  3. #3
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    6

  4. #4
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    832
    Rep Power
    6

    Default

    Hi,
    Iam able to get the output perfectly.Please run it once.

    -Regards
    Ramya
    Ramya:cool:

Similar Threads

  1. problems with java code! (very new - need help asap!)
    By sumkindafreek in forum New To Java
    Replies: 1
    Last Post: 01-07-2009, 05:00 AM
  2. [SOLVED] Threads Help, I think? Please Help ASAP!
    By tornado in forum New To Java
    Replies: 1
    Last Post: 11-30-2008, 04:33 AM
  3. Replies: 3
    Last Post: 11-02-2008, 01:29 AM
  4. Need Java Help ASAP
    By L-dog in forum New To Java
    Replies: 22
    Last Post: 10-02-2008, 11:54 PM
  5. array problems need your help ASAP!
    By notherand in forum New To Java
    Replies: 1
    Last Post: 06-29-2008, 08:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •