diff --git a/BlueJ.FirstSaturday.iml b/BlueJ.FirstSaturday.iml new file mode 100644 index 0000000..c6df852 --- /dev/null +++ b/BlueJ.FirstSaturday.iml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WriteIFs.java b/WriteIFs.java index c05fcae..c4bd656 100644 --- a/WriteIFs.java +++ b/WriteIFs.java @@ -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; } @@ -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(); + } } @@ -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 diff --git a/out/production/BlueJ.FirstSaturday/.gitignore b/out/production/BlueJ.FirstSaturday/.gitignore new file mode 100644 index 0000000..c28a9d8 --- /dev/null +++ b/out/production/BlueJ.FirstSaturday/.gitignore @@ -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/* \ No newline at end of file diff --git a/out/production/BlueJ.FirstSaturday/.vscode/launch.test.json b/out/production/BlueJ.FirstSaturday/.vscode/launch.test.json new file mode 100644 index 0000000..64ebee9 --- /dev/null +++ b/out/production/BlueJ.FirstSaturday/.vscode/launch.test.json @@ -0,0 +1,10 @@ +{ + "run": { + "default": "", + "items": [] + }, + "debug": { + "default": "", + "items": [] + } +} \ No newline at end of file diff --git a/out/production/BlueJ.FirstSaturday/BlueJ.FirstSaturday.iml b/out/production/BlueJ.FirstSaturday/BlueJ.FirstSaturday.iml new file mode 100644 index 0000000..c6df852 --- /dev/null +++ b/out/production/BlueJ.FirstSaturday/BlueJ.FirstSaturday.iml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/BlueJ.FirstSaturday/README.TXT b/out/production/BlueJ.FirstSaturday/README.TXT new file mode 100644 index 0000000..4652f8f --- /dev/null +++ b/out/production/BlueJ.FirstSaturday/README.TXT @@ -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. \ No newline at end of file diff --git a/out/production/BlueJ.FirstSaturday/README.md b/out/production/BlueJ.FirstSaturday/README.md new file mode 100644 index 0000000..b3d3a5e --- /dev/null +++ b/out/production/BlueJ.FirstSaturday/README.md @@ -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). diff --git a/out/production/BlueJ.FirstSaturday/package.bluej b/out/production/BlueJ.FirstSaturday/package.bluej new file mode 100644 index 0000000..d226c47 --- /dev/null +++ b/out/production/BlueJ.FirstSaturday/package.bluej @@ -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 diff --git a/package.bluej b/package.bluej index 01992ee..d226c47 100644 --- a/package.bluej +++ b/package.bluej @@ -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 @@ -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