diff --git a/.idea/misc.xml b/.idea/misc.xml index 6e86672..172df7b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,6 @@ + - + \ No newline at end of file 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..e1006ff 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..1b86056 --- /dev/null +++ b/src/Time.java @@ -0,0 +1,45 @@ +/** + * + * @author Trevor Hartman + * @author Jennifer Gibson + * Date 1-28-2024 + * + * Since Version 1.0 + * + */ +public class Time { + + public static void main(String[] args) { + int hour = 22; + int minutes = 16; + int seconds = 32; + System.out.print("The current time is "); + System.out.print(hour); + System.out.print(":"); + System.out.print(minutes); + System.out.print(":"); + System.out.print(seconds); + System.out.println("."); + + System.out.print("Number of minutes since midnight: "); + System.out.println(hour * 60 + minutes); + + System.out.print("Number of seconds til midnight: "); + System.out.println((24-hour) * 3600- minutes*60); + + System.out.print("Percentage of Day: "); + System.out.println(((hour * 60 + minutes)*100)/1440); + + int hour2 = 23; + int minutes2 = 30; + int seconds2 = 45; + + System.out.print("Homework Duration: "); + System.out.println(hour2-hour); + System.out.print(":"); + System.out.print(minutes2-minutes); + System.out.print(":"); + System.out.print(seconds2-seconds); + System.out.println("."); + } +}