File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ public class Time {
2+ public static void main(String[] args) {
3+ double hour;
4+ double minute;
5+ double second;
6+ hour = 19.0;
7+ minute = 44.0;
8+ second = 40.0;
9+ System.out.println("Number of seconds since midnight:");
10+ System.out.println((hour * 60) * 60 + (minute * 60) + second);
11+ double secondsSinceMidnight;
12+ secondsSinceMidnight = ((hour * 60) * 60 + (minute * 60) + second);
13+ System.out.println("Number of seconds remaining in the day:");
14+ int secondsInTheDay;
15+ secondsInTheDay = ((24 * 60) * 60);
16+ System.out.println(secondsInTheDay - secondsSinceMidnight);
17+ System.out.println("Percentage of the day that has passed:");
18+ System.out.println((secondsSinceMidnight * 100) / secondsInTheDay);
19+ System.out.println("Time elapsed since I started working on this (seconds)");
20+ System.out.println(secondsSinceMidnight - 69630);
21+
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments