|
@@ -2,8 +2,8 @@
|
2
|
2
|
/**
|
3
|
3
|
* Write a description of class WriteIFs here.
|
4
|
4
|
*
|
5
|
|
- * @author (your name)
|
6
|
|
- * @version (a version number or a date)
|
|
5
|
+ * @author Trinh Tong
|
|
6
|
+ * @version 10/18/18
|
7
|
7
|
*/
|
8
|
8
|
public class WriteIFs
|
9
|
9
|
{
|
|
@@ -11,6 +11,10 @@ public class WriteIFs
|
11
|
11
|
public void playerDied(boolean player1) {
|
12
|
12
|
// Write an IF statement that checks “player1.isAlive()”
|
13
|
13
|
// and if that’s false, calls “displayGameOver(player1)”
|
|
14
|
+
|
|
15
|
+ if (player1 == false) {
|
|
16
|
+ displayGameOver(player1);
|
|
17
|
+ }
|
14
|
18
|
|
15
|
19
|
}
|
16
|
20
|
|
|
@@ -18,9 +22,11 @@ public class WriteIFs
|
18
|
22
|
// Write an IF statement that checks the
|
19
|
23
|
// “temperature(room)” and if that check is less than 70,
|
20
|
24
|
// calls “heatOn()” else calls “coolOn()”
|
21
|
|
-
|
22
|
|
-
|
23
|
|
-
|
|
25
|
+ if (tempurature(room) < 70) {
|
|
26
|
+ heatOn();
|
|
27
|
+ } else {
|
|
28
|
+ coolOn();
|
|
29
|
+ }
|
24
|
30
|
return this.ss;
|
25
|
31
|
}
|
26
|
32
|
|
|
@@ -30,13 +36,19 @@ public class WriteIFs
|
30
|
36
|
// AND
|
31
|
37
|
// “insideTemp()” is less than 62,
|
32
|
38
|
// calls “startAFire(fireplace1)”
|
|
39
|
+
|
|
40
|
+ if (outsideTemp() < 50 && insideTemp() < 62) {
|
|
41
|
+ startAFire(fireplace1);
|
|
42
|
+ }
|
33
|
43
|
|
34
|
44
|
}
|
35
|
45
|
|
36
|
46
|
public void checkFuel(double fuelLevel) {
|
37
|
47
|
// Write an IF statement that checks “fuelLevel”
|
38
|
48
|
// and if that check is less than 0.08, calls “refuel()”
|
39
|
|
-
|
|
49
|
+ if (fuelLevel < 0.08) {
|
|
50
|
+ refuel();
|
|
51
|
+ }
|
40
|
52
|
}
|
41
|
53
|
|
42
|
54
|
|