Skip to content

Commit ed83176

Browse files
committed
Published SpiderWebQuiz
1 parent 8871cec commit ed83176

5 files changed

Lines changed: 124 additions & 49 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package org.teachingkidsprogramming.recipes.completed.section07objects;
2+
3+
import org.teachingkidsprogramming.recipes.quizzes.graders.SpiderQuiz;
4+
import org.teachingkidsprogramming.recipes.quizzes.graders.SpiderWebQuizGrader;
5+
6+
public class SpiderWebQuiz extends SpiderQuiz
7+
{
8+
@Override
9+
public void question1()
10+
{
11+
// Do the following the current number of times
12+
for (int i = 0; i < number; i++)
13+
{
14+
// Call circle()
15+
circle();
16+
// Repeat
17+
}
18+
}
19+
public void question2()
20+
{
21+
circleAround();
22+
}
23+
@Override
24+
// Create a subroutine called circleAround which
25+
public void circleAround()
26+
{
27+
// Does the following 3 times
28+
for (int i = 0; i < 3; i++)
29+
{
30+
// Call adjust()
31+
adjust();
32+
// Call question1
33+
question1();
34+
// Repeat
35+
}
36+
}
37+
public void question3()
38+
{
39+
// Create a subroutine called grow which
40+
grow();
41+
// Changes the current length so it is multiplied by 2.5
42+
}
43+
@Override
44+
public void grow()
45+
{
46+
length = length * 2.5;
47+
}
48+
public void question4()
49+
{
50+
// Create a subroutine called shrink which
51+
shrink();
52+
// Decreases the current length by 9 pixels
53+
}
54+
@Override
55+
public void shrink()
56+
{
57+
length = length - 9;
58+
}
59+
public void question5()
60+
{
61+
// Create a subroutine called expand which
62+
expand();
63+
// Increases the current number by 12
64+
}
65+
@Override
66+
public void expand()
67+
{
68+
number = number + 12;
69+
}
70+
public static void main(String[] args)
71+
{
72+
new SpiderWebQuizGrader().grade(new SpiderWebQuiz());
73+
}
74+
}

src/main/java/org/teachingkidsprogramming/recipes/inDevelopment/SmallBasicHolidayCard.java renamed to src/main/java/org/teachingkidsprogramming/recipes/inDevelopment/HolidayCard.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.teachingkidsprogramming.recipes.inDevelopment;
22

3-
public class SmallBasicHolidayCard
3+
public class HolidayCard
44
{
55
//**needs to be translated from the SmallBasic
66
// Holiday Recipe - Enjoy!
@@ -19,20 +19,20 @@ public class SmallBasicHolidayCard
1919
//
2020
// Otherwise,
2121
//
22-
// DrawMerryChristmas(recipe below)
22+
// DrawHappyHolidays(recipe below)
2323
//
2424
// ------------- End of Click recipe
2525
//
2626
//
27-
// ------------- Recipe for DrawMerryChristmas
27+
// ------------- Recipe for DrawHappyHolidays
2828
//
2929
// Play the music for Jingle Bells (Hint:"EEEP4EEEP4EGCDL1E")
3030
//
3131
// Set the font to be 48pt
3232
//
3333
// Set the color of the font to red
3434
//
35-
// Write "Merry Christmas" on the screen at position 150, 150
35+
// Write "Happy Holidays" on the screen at position 150, 150
3636
//
3737
// ------------- End of DrawMerryChristmas recipe
3838
//

src/main/java/org/teachingkidsprogramming/recipes/inDevelopment/SpiderWebQuiz.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/main/java/org/teachingkidsprogramming/recipes/inDevelopment/SmallBasicTicTacToe.java renamed to src/main/java/org/teachingkidsprogramming/recipes/inDevelopment/TicTacToe.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package org.teachingkidsprogramming.recipes.inDevelopment;
22

3-
public class SmallBasicTicTacToe
3+
public class TicTacToe
44
{
5-
//**needs to be translated from the SmallBasic**
5+
//**need to create the TicTacToe board (object) and Player objects**
6+
//
67
// Tell TicTacToe to call PlayInFirstEmptySpot (recipe below) when its Xs turn
78
//
8-
// Start TicTacToe
9+
// Start TicTacToe
910
//
1011
// Recipe for PlayInFirstEmptySpot
1112
//
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package org.teachingkidsprogramming.section07objects;
2+
3+
import org.teachingkidsprogramming.recipes.quizzes.graders.SpiderQuiz;
4+
import org.teachingkidsprogramming.recipes.quizzes.graders.SpiderWebQuizGrader;
5+
6+
public class SpiderWebQuiz extends SpiderQuiz
7+
{
8+
@Override
9+
public void question1()
10+
{
11+
// Do the following the current number of times HINT: "number" is a variable name
12+
// Call circle()
13+
// Repeat
14+
}
15+
public void question2()
16+
{
17+
// Create and then call a recipe called circleAround which
18+
// Does the following 3 times
19+
// Call adjust()
20+
// Call question1
21+
// Repeat
22+
}
23+
public void question3()
24+
{
25+
// Create and then call a recipe called grow which
26+
// Changes the current length so it is multiplied by 2.5
27+
}
28+
public void question4()
29+
{
30+
// Create and then call a recipe called shrink which
31+
// Decreases the current length by 9 pixels
32+
}
33+
public void question5()
34+
{
35+
// Create and then call a recipe called expand which
36+
// Increases the current number by 12
37+
}
38+
public static void main(String[] args)
39+
{
40+
new SpiderWebQuizGrader().grade(new SpiderWebQuiz());
41+
}
42+
}

0 commit comments

Comments
 (0)