I'm a novice programmer and I am trying to solve this annoying problem with my code.
import java.util.Scanner;
public class TestLab100
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int milisec, sec, hour, minute, remainderMi, remainderS, remainderH, remainderM;
System.out.print("Starting milli-seconds: ");
milisec = keyboard.nextInt();
hour = milisec/ 3600000;
remainderH = milisec% 3600000;
minute = remainderH/ 60;
remainderS= minute/1000;
remainderM = minute%1000;
remainderMi = remainderM% 1000;
System.out.println("Hours: " + hour);
System.out.println("Minutes: " + remainderS);
System.out.println("Seconds: " + remainderM);
System.out.println("Milli Seconds: " + remainderMi);
}
}
I need the seconds to result in 40 and the milliseconds to be 123; well that's what they should be. Thanks for any help.