forked from veevism/ComPro_CAMT64
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimeCalculator.java
More file actions
31 lines (26 loc) · 759 Bytes
/
Copy pathTimeCalculator.java
File metadata and controls
31 lines (26 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.Scanner;
public class TimeCalculator {
public static void main(String[] args) {
Scanner mamamia = new Scanner(System.in);
System.out.println("Please enter second you bitch");
int second = mamamia.nextInt();
int min = 0;
int hour = 0;
int day = 0;
while (second >= 60) {
if (second >= 60) {
min += 1;
second -= 60;
}
if (min >= 60) {
hour += 1;
min -= 60;
}
if (hour >= 24) {
day += 1;
hour -= 24;
}
}
System.out.println(day + " day" + hour + " hour" + min + " min" + second + " sec");
}
}