- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise16.java
More file actions
Latest commit
28 lines (23 loc) · 1 KB
/
Copy pathExercise16.java
File metadata and controls
28 lines (23 loc) · 1 KB
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
publicclassExercisenumber16 {
publicstaticvoidmain() {
// The following program has many bugs. Fix them all.
longstart = 1567605600000L; // Sept 4, 2019 at 11am EST
longnow = System.currentTimeMillis();
longelapsed = now - stert;
longdays = elapsed / (24x60x60x1000);
System.out.println("It has been more than " + days + " days since you" +
" started to learn Java!")
System.out.print("How is it going so far? ");
Stringresponse = StdIn.readString();
System.out.println("I'm glad to hear it is going " + response + "!");
System.out.print("On a scale of 1 to 10, how hard do you think it is? ");
doublehardness = StdIn.readDouble();
if (hardness < 3) {
System.out.println("Really, you think it is that easy?!");
} elseif (hardness > 7) {
System.out.println("I hear you. Don't hesitate to go to office hours!");
} else {
System.out.println("Great!");
}
}
}