Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Hello, I am stuck as to what to do from here in this hopefully simple prog

807599Mar 6 2007 — edited Mar 6 2007
I am trying to write a program that the user can enter any number in any unit of these (seconds, minutes, hours, centihours, or years). Then it should ask what to convert it into then the user could choose to convert it to seconds, minutes,hours, centihours, or years.
Any ideas?
This is what I have so far but I am stuck as to what to do from here:

import javax.swing.JOptionPane;
public class converttime{
public static void main (String[] args){

double inputNum = Double.parseDouble(JOptionPane.showInputDialog(null,"Enter a number: "));

Sring unit = JOptionPane.showInputDialog(null,"What unit is the number entered in? ");

String convert = JOptionPane.showInputDialog(null, "Do you want this converted into seconds, minutes, hours, centihours, or years?");

}
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 3 2007
Added on Mar 6 2007
4 comments
121 views