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
77 changes: 0 additions & 77 deletions .gitignore

This file was deleted.

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>
Empty file.
Binary file added out/production/Java-Assignment-002/Time.class
Binary file not shown.
28 changes: 28 additions & 0 deletions src/Time.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

public class Time {
public static void main(String[] args) {
int hour = 10;
int minute = 39;
int second = 43;
System.out.print("Number of seconds since midnight ");
System.out.println(second+hour*3600+minute*60);
int secondssincemidnight = (second + minute * 60 + hour * 3600);
int secondsinaday = (24 * 3600);
int secondsleft = (secondsinaday-secondssincemidnight);
System.out.print("seconds left until midnight ");
System.out.println(secondsleft);
double percentofday = (double) secondssincemidnight/secondsinaday*100;
System.out.print("Percentage of the day that has passed ");
System.out.println(percentofday);
int hour1 = 11;
int minute1 = 44;
int second1 = 55;
System.out.print("Time spent on this project ");
System.out.print(hour1-hour);
System.out.print(" Hours ");
System.out.print(minute1-minute);
System.out.print(" Minutes and ");
System.out.print(second1-second);
System.out.println(" Seconds ");
}
}