Hey guys I'm doing this for my own knowledge and honestly learn better after looking at what needs to be done. I simply cannot understand how to do this right now.... the task is
Write a program that asks the user to enter a number of seconds. (Use JOptionPane for getting the input).
There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes in that many seconds.
There are 3600 seconds in an hour . If the number of seconds entered by the user is greater than or equal to 3600 the program should display the number of minutes in that many seconds.
There are 86,400 seconds in a day. If the number of seconds entered by the user is greater than or equal to 86400 the program should display the of minutes in that many seconds.
As far as i can get is import javax.swing.*; class TimeCalculator { public static void main(String[] args) {
String number;
JFrame frame = new JFrame("InputDialog Example #2");
String code = JOptionPane.showInputDialog(
frame,
"Enter any number of seconds",
"Number",
JOptionPane.WARNING_MESSAGE
);
System.out.printf("There are %s minutes in __ seconds \n" ,code);
System.exit(0);
} } Having trouble even writing my if statement :/ please help!!!! Thanks...
Aucun commentaire:
Enregistrer un commentaire