forked from ChrisMayfield/ThinkJavaCode2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrintingVars.java
More file actions
28 lines (21 loc) · 829 Bytes
/
PrintingVars.java
File metadata and controls
28 lines (21 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public class PrintingVars {
public static void main(String[] args) {
String firstLine = "Hello, again!";
System.out.println(firstLine);
System.out.print("The value of firstLine is ");
System.out.println(firstLine);
int hour = 11;
int minute = 59;
System.out.print("The current time is ");
System.out.print(hour);
System.out.print(":");
System.out.print(minute);
System.out.println(".");
System.out.print("Number of minutes since midnight: ");
System.out.println(hour * 60 + minute);
System.out.print("Fraction of the hour that has passed: ");
System.out.println(minute / 60);
System.out.print("Percent of the hour that has passed: ");
System.out.println(minute * 100 / 60);
}
}