Skip to content

Commit 79e4934

Browse files
committed
working on DD7 w/Jim
1 parent 66aa60c commit 79e4934

File tree

3 files changed

+46
-10
lines changed

3 files changed

+46
-10
lines changed
118 Bytes
Binary file not shown.

TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/ConnectTheDots.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class ConnectTheDots implements MouseRightClickListener, MouseLeftClickLi
77
{
88
public static void main(String[] args)
99
{
10-
//Create a Connect The Dots window. --#1.1
10+
//Create a new 'Connect The Dots' window. --#1.1
1111
}
1212
public ConnectTheDots()
1313
{

TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/DeepDive07Events.java

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package org.teachingkidsprogramming.section07events;
22

3-
import java.awt.Color;
43
import java.awt.Cursor;
54

65
import org.junit.Assert;
76
import org.junit.Test;
87
import org.teachingextensions.logo.Tortoise;
8+
import org.teachingextensions.logo.Turtle;
99
//This deepdive is in progress!
1010

1111
//
@@ -21,17 +21,52 @@ public class DeepDive07Events
2121
// Step 5: Advance to the next method
2222
// Do not change anything except the blank (___)
2323
//
24-
// concepts:
25-
// events
26-
// event listeners - right click
24+
// concepts:
25+
// events / multiple event listeners - right click
2726
// 'this' - instance(s) - multiple Tortoises
27+
// exploring Object methods other than Tortoise---Circle (TKP)...methods
2828
@Test
2929
public void concatenateString() throws Exception
3030
{
3131
//create a new string from the strings "happy " + "baby"
3232
String[] words = {"happy ", ___};
3333
Assert.assertEquals("happy baby", words);
3434
}
35+
@Test
36+
public void twoTortoises() throws Exception
37+
{
38+
Tortoise rafael = new Tortoise();
39+
Tortoise michealangelo = new Tortoise();
40+
boolean result = rafael.equals(michealangelo);
41+
Assert.assertEquals(______, result);
42+
}
43+
@Test
44+
public void twoTortoisesAgain() throws Exception
45+
{
46+
Tortoise rafael = new Tortoise();
47+
Tortoise anonymousNinja = rafael;
48+
boolean result = rafael.equals(anonymousNinja);
49+
Assert.assertEquals(_____, result);
50+
}
51+
@Test
52+
public void twoTortoisesYetAgain() throws Exception
53+
{
54+
Tortoise rafael = new Tortoise();
55+
Tortoise michealangelo = new Tortoise();
56+
Tortoise anonymousNinja = ________;
57+
boolean result = michealangelo.equals(anonymousNinja);
58+
Assert.assertEquals(true, result);
59+
}
60+
//"this" Tortoise belongs here (to this Object)
61+
private Turtle leonardo;
62+
@Test
63+
public void sadTortoise() throws Exception
64+
{
65+
this._______ = new Turtle();
66+
//sorry, leonardo must die now - joking
67+
this.leonardo.getPenWidth();
68+
Assert.assertEquals(2, this.leonardo.getPenWidth());
69+
}
3570
/**
3671
* Ignore the following, It's needed to run the homework
3772
*
@@ -45,11 +80,12 @@ public void concatenateString() throws Exception
4580
*
4681
*
4782
*/
48-
public boolean _____ = false;
49-
public boolean ______ = true;
50-
public String ___ = "You need to fill in the blank ___";
51-
public int ____ = 0;
52-
public Color _______;
83+
public boolean _____ = false;
84+
public boolean ______ = true;
85+
public String ___ = "You need to fill in the blank ___";
86+
public int ____ = 0;
87+
public Turtle _______;
88+
public Tortoise ________;
5389
public String ___()
5490
{
5591
return ___;

0 commit comments

Comments
 (0)