I'm running this in VS code and compiling and running through terminal with the proper JDK installed but nothing seems to run it just goes blank and then I type "clear" and a mismatch exception is thrown. Can someone explain why? Thank you :)
import java.util.Scanner;
class realTime {
public static void Time(int seconds) {
int min = 0, hours = 0;
min = (int)seconds / 60;
hours = (int)seconds / 3600;
System.out.println("Hours: " + hours);
System.out.println("Minutes: " + min);
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int seconds = scan.nextInt();
Time(seconds);
}
}
I know that it will not calculate the min and hours correctly I'm just putting code down to test whether it runs.