a little help with beginner java

bobcpg

Senior member
Nov 14, 2001
951
0
0
here is my code, i want to envoke the method convertHours from the main method but its giving me an error after the convertHours header???

what am i doing wrong?
-bob






// This program accepts a number of seconds and finds out how many seconds
// minutes, and seconds left.


import javax.swing.JOptionPane;

public class LabC2 {

public static void main(String[] args){

String num1Str =
JOptionPane.showInputDialog("Please enter Enter number of seconds: ");
int numOfSeconds = Integer.parseInt(num1Str);
convertHours(numOfSeconds);

System.exit(0);
}
public static void convertHours(int numberOfSecondsTwo){

int numOfHours = numOfSecondsTwo / 3600;
int numOfMinutes = (numOfSecondsTwo - numOfHours * 3600) / 60;
int numOfSecondsLeft = (numOfSecondsTwo - ((numOfMinutes * 60) +
(numOfHours * 3600)));

JOptionPane.showMessageDialog(null, "Hours: " + numOfHours +
"\nMinutes: " + numOfMinutes + "\nSeconds: " + numOfSecondsLeft);
};
}