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
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="jdk" jdkName="openjdk-20" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
32 changes: 32 additions & 0 deletions src/Time.java
Original file line number Diff line number Diff line change
@@ -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");
}
}