diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Java-Assignment-002.iml b/Java-Assignment-002.iml index b46c0dd..8ad7c06 100644 --- a/Java-Assignment-002.iml +++ b/Java-Assignment-002.iml @@ -5,6 +5,7 @@ + \ No newline at end of file diff --git a/src/Time.java b/src/Time.java new file mode 100644 index 0000000..5f4487b --- /dev/null +++ b/src/Time.java @@ -0,0 +1,32 @@ +/** + * + * @author Jenny Li + * @since Version 1.0 + * (1/28/24) + * + */ + +public class Time { + public static void main(String[] args) { + + //int hour = 20; + //int minute = 10; + //int second = 46; + + //System.out.print("The number of seconds since midnight is: "); + //System.out.println(hour * 3600 + minute * 60 + second); + + //System.out.print("The number of seconds remaining in the day are: "); + //System.out.println(((24-hour) * 3600) + ((60 - minute) * 60) + (60 - second)); + + //System.out.print("Fraction of the hour that has passed: "); + //System.out.println((hour * 100) / 24); + + int hours = 21; + int minutes = 2; + int seconds = 50; + + System.out.print("Time since the start of this exercise: "); + System.out.print((hours - 20) + " hour" + (50 + minutes) + " minutes" + (seconds - 46) + " seconds"); + } +} \ No newline at end of file