Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passed all test cases #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
21 changes: 21 additions & 0 deletions BlueJ.FirstSaturday.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="JUnit4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
35 changes: 22 additions & 13 deletions WriteIFs.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,30 @@
*/
public class WriteIFs
{

int x = 0;
int tt_t = 0;
int tt_s = 1;
String ss = "";
int oo1 = 61;
int oo2 = 49;

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(true);
}
}

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 +40,17 @@ 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 All @@ -60,12 +74,7 @@ public void checkFuel(double fuelLevel) {
public WriteIFs()
{
// initialise instance variables
x = 0;
tt_t = 0;
tt_s = 1;
ss = "";
oo1 = 61;
oo2 = 49;

}

// associated routines
Expand Down
25 changes: 25 additions & 0 deletions out/production/BlueJ.FirstSaturday/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

.idea/*
10 changes: 10 additions & 0 deletions out/production/BlueJ.FirstSaturday/.vscode/launch.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"run": {
"default": "",
"items": []
},
"debug": {
"default": "",
"items": []
}
}
21 changes: 21 additions & 0 deletions out/production/BlueJ.FirstSaturday/BlueJ.FirstSaturday.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="JUnit4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
23 changes: 23 additions & 0 deletions out/production/BlueJ.FirstSaturday/README.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FIRST SATURDAY
==============

Lab Brief
---------

The objective of this lab is to give you an opportunity to think through IF statements
and LOOPS (WHILE, DO WHILE, and FOR).

You will need to read the TEST classes first, to get a feel for what you have to write
for the CODE classes.

Work through code class WriteIFs.java, follow the directions for each method.
Run All Tests on the class until you pass them all.

Work through code class WriteLoops.java, follow the directions for each method.
Run All Tests on the class until you pass them all. For each of the loop methods,
you need to put the code about w = w + 1; inside of the loops. It lets the test know how
many iterations of the loop your code did. This data is used to make sure you passed the tests.

You may not change ANY existing test methods. You get extra credit(!) for each test you add.

Be sure to pass all the tests with your code.
19 changes: 19 additions & 0 deletions out/production/BlueJ.FirstSaturday/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
* This lab has been separated into several labs:
* [ControlsChecker.BlueJ](https://github.com/Zipcoder/controlschecker.bluej)
* [ThresholdEvaluator.BlueJ](https://github.com/Zipcoder/thresholdevaluator.bluej)
* more to come...

# First Saturday

First weekend lab. Overall idea is to read the code, read the tests, and then write some code to pass all the tests.

Be sure to commit all your changes multiple times as you're working on the lab.

`git commit -m "checkpointing my work"` should do, be sure to change the message to something meaningful to the work you're saving.

When you are finished, and are passing all the tests, be sure to do a final `git commit` and then do a `Pull Request` so we can review your work.




now see [README.TXT](README.TXT).
67 changes: 67 additions & 0 deletions out/production/BlueJ.FirstSaturday/package.bluej
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#BlueJ package file
dependency1.from=WriteLoopsTest
dependency1.to=WriteLoops
dependency1.type=UsesDependency
dependency2.from=WriteIFsTest
dependency2.to=WriteIFs
dependency2.type=UsesDependency
editor.fx.0.height=726
editor.fx.0.width=1018
editor.fx.0.x=262
editor.fx.0.y=23
objectbench.height=116
objectbench.width=1241
package.divider.horizontal=0.6
package.divider.vertical=0.8185840707964602
package.editor.height=548
package.editor.width=1147
package.editor.x=112
package.editor.y=23
package.frame.height=736
package.frame.width=1265
package.numDependencies=2
package.numTargets=5
package.showExtends=true
package.showUses=true
project.charset=UTF-8
readme.height=60
readme.name=@README
readme.width=48
readme.x=10
readme.y=10
target1.height=110
target1.name=WriteLoopsTest
target1.showInterface=false
target1.type=UnitTestTargetJunit4
target1.width=100
target1.x=170
target1.y=330
target2.association=WriteLoopsTest
target2.height=110
target2.name=WriteLoops
target2.showInterface=false
target2.type=ClassTarget
target2.width=100
target2.x=140
target2.y=360
target3.height=110
target3.name=WriteIFsTest
target3.showInterface=false
target3.type=UnitTestTargetJunit4
target3.width=80
target3.x=180
target3.y=100
target4.association=WriteIFsTest
target4.height=110
target4.name=WriteIFs
target4.showInterface=false
target4.type=ClassTarget
target4.width=80
target4.x=150
target4.y=130
target5.height=70
target5.name=README.md
target5.type=TextTarget
target5.width=120
target5.x=70
target5.y=10
34 changes: 20 additions & 14 deletions package.bluej
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ dependency1.type=UsesDependency
dependency2.from=WriteIFsTest
dependency2.to=WriteIFs
dependency2.type=UsesDependency
editor.fx.0.height=722
editor.fx.0.width=800
editor.fx.0.x=560
editor.fx.0.y=118
objectbench.height=101
objectbench.width=740
editor.fx.0.height=726
editor.fx.0.width=1018
editor.fx.0.x=262
editor.fx.0.y=23
objectbench.height=116
objectbench.width=1241
package.divider.horizontal=0.6
package.divider.vertical=0.8625954198473282
package.editor.height=671
package.editor.width=1139
package.divider.vertical=0.8185840707964602
package.editor.height=548
package.editor.width=1147
package.editor.x=112
package.editor.y=89
package.frame.height=844
package.editor.y=23
package.frame.height=736
package.frame.width=1265
package.numDependencies=2
package.numTargets=4
package.numTargets=5
package.showExtends=true
package.showUses=true
project.charset=UTF-8
readme.height=58
readme.height=60
readme.name=@README
readme.width=47
readme.width=48
readme.x=10
readme.y=10
target1.height=110
Expand Down Expand Up @@ -59,3 +59,9 @@ target4.type=ClassTarget
target4.width=80
target4.x=150
target4.y=130
target5.height=70
target5.name=README.md
target5.type=TextTarget
target5.width=120
target5.x=70
target5.y=10