Upload
stell-ac
View
216
Download
0
Embed Size (px)
Citation preview
8/18/2019 CS AliceChapter1Questions HW
1/2
1.1
Object: an abstraction that contains the data and instructions to carry out tasks.
Class: A template definition of the methods and variables of a particular object.
Method: An action that is performed by the object, but does not give back feedback.
arameter: !imitations set on a method to make it more specific.
roperty: A trait of the object.
1."
Move is less specific and can refer to any of # objects, $hile move at speed refers to a specific direction and
specified rate.
1.%
Asking the object to e&ecute an action.
1.'
dancer turn right %
1.(
tree resi)e %
1.#
cheerleader turn to face camera
1.*
+ou $ould drag -o together into the method, and put actions in there. /or e&le, if 0 $anted to make a tree
resi)e and move up 1 m 0 $ould drag -o together to the bo&, and put those methods under -o together.
1.
2he chicken is a composite object, because 0t contains more than one object. 2he chicken contains: !eft!eg, /oot,
3ightleg, /oot, 4eck, 5ead, 6pper!ip and !o$er!ip.
1.7
2he barn has building, $hich contains: front8indo$, roof, left-oor, right-oor, back8indo$, theleftMain3after, $hich includes: rafter1, post1, post", post%, post', post(, post#, post*, post, post7, rafter%,
rafter(,rafter*, rafter7, rafer11, rafter1%, rafter1(, rafter1#, rafter1', rafter1", rafter19, rafter, rafter#,
rafter', rafter". rightMain3after includes: rafter(, rafter*, rafter1, post1, post", post%, post', post(, post#,
post*, post, rafter1(, rafter%, rafter", rafter', rafter7, rafter11, rafter1%, rafter#, rafter1', rafter1", rafter19,
rafter, post7, rafter1#.
1.19
8/18/2019 CS AliceChapter1Questions HW
2/2
+ou $ould go to the object tree and click the particular object. /or e&le, if 0 $anted to access the
handle, 0 $ould click phonograph, then crank, $hich $ould lead me to handle.