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
40 changes: 31 additions & 9 deletions WriteIFs.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,34 @@
*/
public class WriteIFs
{

/* int x;
int tt_t;
int tt_s;
String ss;
int oo1, 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) == false){
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(tempurature(room) < 70){

heatOn();
}

else{
coolOn();
}


return this.ss;
}
Expand All @@ -31,30 +46,38 @@ public void fireplaceControl(Object fireplace1) {
// “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();
}

}



/**
/*
* Pay no attention to the code below this point.
*
*
* instance variables
* /
*/
int x;
int tt_t;
int tt_s;
int oo1, oo2;
String ss;


/**
/*
* Constructor for objects of class WriteIFs
*/
public WriteIFs()
Expand All @@ -81,7 +104,6 @@ private void heatOn() {
private void coolOn() {
this.ss = "cooling";
}

private int insideTemp() {
return oo1;
}
Expand Down
Loading