Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Java-Assignment-002.iml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
45 changes: 45 additions & 0 deletions src/Time.java
Original file line number Diff line number Diff line change
@@ -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(".");
}
}