Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.math.*;
- public class Lesson_32_Activity_Four {
- static Scanner scanner = new Scanner(System.in);
- public static void realTime(int input) {
- int hours = input / 3600;
- int temp = input - (hours * 3600);
- int minutes = temp / 60;
- temp = temp - (minutes * 60);
- int seconds = temp ;
- System.out.println("Hours: " + hours);
- System.out.println("Minutes: " + minutes);
- System.out.println("Seconds: " + seconds);
- }
- public static void main(String[] args) {
- System.out.println("How many seconds?");
- int input = scanner.nextInt();
- realTime(input);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement