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
30 changes: 23 additions & 7 deletions WriteIFs.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
import javax.swing.JLayer;

/**
* Write a description of class WriteIFs here.
*
* @author (your name)
* @version (a version number or a date)
* @author dipinti
* @version 06/30/2021
*/
public class WriteIFs
{
String ss;
int tt_s;
int x;
int tt_t;
int oo1;
int oo2;


public void playerDied(boolean player1) {
// Write an IF statement that checks “player1.isAlive()”
// and if that’s false, calls “displayGameOver(player1)”
if(isAlive(player1)){
return;
}
displayGameOver(player1);

}

public String thermoSTAT(int room) {
// Write an IF statement that checks the
// “temperature(room)” and if that check is less than 70,
// calls “heatOn()” else calls “coolOn()”



if(room<70){
heatOn();
}
else coolOn();
return this.ss;
}

Expand All @@ -30,13 +43,16 @@ public void fireplaceControl(Object fireplace1) {
// AND
// “insideTemp()” is less than 62,
// calls “startAFire(fireplace1)”

if(outsideTemp()<50 &&(insideTemp()<62)){
startAFire(fireplace1);
}
}

public void checkFuel(double fuelLevel) {
// Write an IF statement that checks “fuelLevel”
// and if that check is less than 0.08, calls “refuel()”

if(fuelLevel<0.08)
{refuel();}
}


Expand Down
6 changes: 2 additions & 4 deletions WriteIFsTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
Expand All @@ -9,8 +7,8 @@
* The test class WriteIFsTest.
*
* @author kyounger
* @version 1.3
*/
* @version 1.2
* */
public class WriteIFsTest
{
private static final double _0_5 = 0.5;
Expand Down
Loading