Programarejava.wikispaces.com File View Midsect3+Silvia.
Click here to load reader
Transcript of Programarejava.wikispaces.com File View Midsect3+Silvia.
8/13/2019 Programarejava.wikispaces.com File View Midsect3+Silvia.
http://slidepdf.com/reader/full/programarejavawikispacescom-file-view-midsect3silvia 1/7
Secti on 2
1. Whi ch of t he f ol l owi ng i s not a st ep i n t he Al i ce ani mati on devel opment process? Mark f or Revi ew(1) Poi nt s
Sel l t he ani mati on ( *)
Def i ne t he scenari o
Run the ani mat i on
Desi gn a st oryboar d
Program t he ani mati on
Corr ect
2. I n Al i ce, whi ch of t he f ol l owi ng programmi ng st atement s moves the but t erf l y f orward, doubl e t he di st ance t o t he t r ee? Mark f or(1) Poi nt s
t hi s. Butt erf l y move f orward {t hi s. Butt erf l y get Di st anceTo t hi s. Tree * 2} ( *)
t hi s. Butt erf l y move backward {t hi s. Butt erf l y getDi st anceTo t hi s. Tree * 2}
t hi s. Butt erf l y move backward {t hi s. Butt erf l y getDi st anceTo t hi s. Tree / 2}
t hi s. Butt erf l y move f orward {t hi s. Butt erf l y get Di st anceTo t hi s. Tree / 2}
Corr ect
3. Fromyour Al i ce l essons, t he I f contr ol st ructur e can process one t rue and one f al se response. True or f al se? Mark for Revi ew
(1) Poi nt s
Tr ue ( *)
Fal se
Corr ect
4. I n Al i ce, we use t he Whi l e cont r ol st atement t o i mpl ement t he condi t i onal l oop. Tr ue or f al se? Mark for Revi ew(1) Poi nt s
Tr ue ( *)
Fal se
Corr ect
5. A l oop can be i nfi ni t e ( conti nue f orever) or condi t i onal ( st ops upon a condi t i on) . Tr ue or fal se? Mark f or Revi ew
(1) Poi nt s
Tr ue ( *)
Fal se
Secti on 2
6. I n Al i ce, procedural abst ract i on i s t he concept of maki ng code easi er t o underst and and reuse. True or f al se? Mark f or Revi ew(1) Poi nt s
Tr ue ( *)
Fal se
Corr ect
7. I n Al i ce, i f a pr ocedur e i s decl ared f or MyCl ownFi sh, whi ch cl asses can use t he procedure? Mark for Revi ew(1) Poi nt s
MyCl ownFi sh cl ass and MySwi mmer cl ass
MyCl ownFi sh cl ass (* )
MyPaj amaFi sh cl ass, MyCl ownFi sh cl ass, and MySwi mmer cl ass
Any cl ass wi t h "Fi sh" i n the cl ass name
I ncorr ect . Refer t o Sect i on 2 Lesson 4.
8. I n Al i ce, whi ch of t he f ol l owi ng are benef i t s of separati ng out moti ons i nto thei r own procedures? Mark for Revi ew(1) Poi nt s
( Choose al l correct answers)
I t makes t he ani mati on easi er t o run.
I t makes t he scene easi er t o vi ew.
I t si mpl i f i es code and makes i t easi er to read. ( *)
I t al l ows many obj ects of a cl ass t o use the same pr ocedur e. ( *)
I t can al l ow subcl asses of a supercl ass to use a procedure. ( *)
Page 1 of 7
6/1/2014http://programarejava.wikispaces.com/file/view/midsect3+silvia.txt
8/13/2019 Programarejava.wikispaces.com File View Midsect3+Silvia.
http://slidepdf.com/reader/full/programarejavawikispacescom-file-view-midsect3silvia 2/7
I ncorr ect . Refer t o Secti on 2 Lesson 4.
9. I n Al i ce, whi ch of t he f ol l owi ng i nstr ucti ons move t he Bl ue Tang f i sh f orward 2 meter s? Mark for Revi ew(1) Poi nt s
t hi s. bl ueTang move Forward 0. 2
t hi s. bl ueTang move For ward 2
t hi s. bl ueTang move Backwar d 2
t hi s. bl ueTang move Forward 2. 0 (* )
Corr ect
10. From your Al i ce l essons, t he Do I n Or der contr ol s t atement i s al so r efer r ed t o by what ot her name? Mark f or Revi ew(1) Poi nt s
Sequence contr ol
Sequenti al contr ol (*)
Cont r ol order
Or der contr ol
I ncorr ect . Refer t o Sect i on 2 Lesson 3.
Secti on 2
11. I n Al i ce, whi ch of t he f ol l owi ng procedures pl ay a sound? Mark f or Revi ew
(1) Poi nt s
pl aySound
pl ayAudi o ( *)
pl aySoundFi l e
pl ayFi l e
I ncorr ect . Refer t o Sect i on 2 Lesson 3.
12. Fromyour Al i ce l essons, t he "Checkl i st f or Ani mati on Compl eti on" does not ask questi ons about the scenari o and st oryboar ds, bec(1) Poi nt s
Tr ue
Fal se (*)
Corr ect
13. Fromyour Al i ce l essons, when codi ng f or keyboard contr ol , t he progr ammer' s j ob i s t o consi der at l east 70% of every key str oke(1) Poi nt s
Tr ue
Fal se (*)
I ncorr ect . Refer t o Sect i on 2 Lesson 8.
14. Fromyour Al i ce l essons, you can r un t he ani mati on t o t est that i t works pr operl y. True or f al se? Mark for Revi ew(1) Poi nt s
Tr ue ( *)
Fal se
I ncorr ect . Refer t o Sect i on 2 Lesson 8.
15. Expressi ons wi t h rel ati onal operat ors pr oduce t rue and f al se val ues. True or f al se? Mark for Revi ew(1) Poi nt s
True ( *)Fal se
Corr ect
16. Whi ch of the f ol l owi ng does not descr i be vari abl es? Mark f or Revi ew(1) Poi nt s
A pl ace i n memory wher e data of a speci f i c t ype can be stor ed f or l ater r etr i eval and use.
Has a uni que name.
Has a type associ ated wi t h i t .
Ar r anged i n rows and col umns. ( *)
Corr ect
17. Fr omyour Al i ce l essons, a Do Toget her st atement embedded wi t h t wo move st at ements i s an exampl e of what? Mark f or Revi ew(1) Poi nt s
Page 2 of 7
6/1/2014http://programarejava.wikispaces.com/file/view/midsect3+silvia.txt
8/13/2019 Programarejava.wikispaces.com File View Midsect3+Silvia.
http://slidepdf.com/reader/full/programarejavawikispacescom-file-view-midsect3silvia 3/7
Harmony
Compi l ati on
Forward thi nki ng
Nesti ng (*)
I ncorr ect . Refer t o Sect i on 2 Lesson 5.
18. I n Al i ce, once procedures ar e added t o a cont r ol st atement , t hey cannot be changed. True or f al se? Mark f or Revi ew(1) Poi nt s
Tr ue
Fal se (*)
I ncorr ect . Refer t o Sect i on 2 Lesson 5.
19. Do I n Or der and Do Together are t he onl y cont r ol s t atement s avai l abl e i n Al i ce. True or f al se? Mark f or Revi ew(1) Poi nt s
Tr ue
Fal se (*)
I ncorr ect . Refer t o Sect i on 2 Lesson 5.
20. Fromyour Al i ce l essons, buil t - i n f uncti ons provide preci se property det ail s for t he f oll owi ng areas: Mark f or Revi ew(1) Poi nt s
Proxi mi t y and si ze
Di st ance to and nesti ng
Proxi mi ty, si ze, spati al r el ati on, and poi nt of vi ew (*)
Proxi mi t y and poi nt of vi ew
Corr ect
21. Whi ch of t he f ol l owi ng i s not an exampl e of t he l ogi c of an I F cont rol st r uct ure? Mark for Revi ew(1) Poi nt s
Pl ay t he vi deo three t i mes. ( *)
I f t he pl ay but t on i s pressed, t hen pl ay t he vi deo one t i me.
I f t he doorbel l ri ngs, t hen t he door opens.
I f the bi rd r i ngs the bel l , a treat i s di spensed.
Corr ect
22. Whi ch of t he f ol l owi ng st atement s about methods i s fal se? Mark for Revi ew(1) Poi nt s
Cl asses must be def i ned di rectl y wi t hi n a method defi ni t i on. ( *)
Methods whose ret urn type i s not voi d ar e requi r ed t o i ncl ude a r etur n stat ement speci f yi ng what t o ret urn.
The or der i n whi ch methods are l i st ed wi t hi n t he cl ass i s not i mport ant .
J ava does not permi t nest i ng one method def i ni t i on wi t hi n another met hod' s def i ni t i on.
I ncorr ect . Refer t o Sect i on 2 Lesson 10.
23. From your Al i ce l essons, how do you add an i nstance t o a scene i n Al i ce? Mark for Revi ew(1) Poi nt s
Sel ect t he i nstance f rom your comput er' s network.
Wr i t e code t hat pl aces t he i nstance i n t he scene.
Sel ect t he cl ass, t hen drag the obj ect i nto the scene. ( *)
Cal l t he addObj ect method.
Corr ect
24. Al l obj ects i n Al i ce have t hree di mensi onal coordi nat es on whi ch axes? Mark for Revi ew(1) Poi nt s
( Choose al l correct answers)
x (*)
y (*)
z ( * )
w
Page 3 of 7
6/1/2014http://programarejava.wikispaces.com/file/view/midsect3+silvia.txt
8/13/2019 Programarejava.wikispaces.com File View Midsect3+Silvia.
http://slidepdf.com/reader/full/programarejavawikispacescom-file-view-midsect3silvia 4/7
Al l of t he above
I ncorr ect . Refer t o Sect i on 2 Lesson 2.
25. From your Al i ce l essons, what i s a one-shot procedural method? Mark for Revi ew(1) Poi nt s
A procedure t hat i s i nvoked when the Run but t on i s cl i cked.
A pr ocedur e t hat i s used to make a scene adj ustment . ( *)
A procedure that i s dragged i nto t he code edi t or.
A pr ocedur e t hat i s used to l aunch t he pr ogr am.
Corr ect
Secti on 3
26. Whi ch of t he f ol l owi ng J ava syntax i s used t o corr ectl y cr eat e a Duke subcl ass? Mark for Revi ew(1) Poi nt s
pri vate Dog extends Wor l d
publ i c cl ass Dog extends Worl d
publ i c cl ass Duke ext ends Ani mal ( *)
pri vat e cl ass extends Actor
pri vate cl ass extends Duke
Corr ect
27. I n Greenf oot , a subcl ass i s a speci al i zati on of a supercl ass. True or fal se? Mark f or Revi ew(1) Poi nt s
Tr ue ( *)
Fal se
Corr ect
28. Fromyour Greenf oot l essons, source code i s wri t t en i n t he code edi t or. True or f al se? Mark for Revi ew(1) Poi nt s
Tr ue ( *)
Fal se
Corr ect
29. I n Greenf oot , a vari abl e can be saved and accessed l ater, even i f t he i nstance no l onger exi st s. True or f al se? Mark for Revi e(1) Poi nt s
Tr ue
Fal se (*)
Corr ect
30. What does the f ol l owi ng Gr eenf oot pr ogrammi ng st atement do?
turn( 18) ; Mark f or Revi ew(1) Poi nt s
Turn t he obj ect 36 degr ees.
Turn t he obj ect 18 degr ees. ( *)
Turn t he obj ect 18 st eps f orwar d.
Move t he obj ect 18 st eps f orward.
Corr ect
Secti on 3
31. I n t he Gr eenf oot I DE, whi ch of t he f ol l owi ng are components of a parameter ? Mark f or Revi ew(1) Poi nt s
( Choose al l correct answers)
Parameter t ype (* )
Parameter r etur n
Parameter name (*)
Par amet er met hod
Parameter voi d
Page 4 of 7
6/1/2014http://programarejava.wikispaces.com/file/view/midsect3+silvia.txt
8/13/2019 Programarejava.wikispaces.com File View Midsect3+Silvia.
http://slidepdf.com/reader/full/programarejavawikispacescom-file-view-midsect3silvia 5/7
8/13/2019 Programarejava.wikispaces.com File View Midsect3+Silvia.
http://slidepdf.com/reader/full/programarejavawikispacescom-file-view-midsect3silvia 6/7
39. Use you Gr eenf oot knowl edge: What r ange of numbers does the f ol l owi ng method r eturn?
Gr eenf oot . getRandomNumber( 30) Mar k f or Revi ew(1) Poi nt s
A random number bet ween 1 and 30.
A random number bet ween 0 and 30.
A random number bet ween 0 and 29. ( *)
A random number bet ween 1 and 29.
I ncorr ect . Refer t o Sect i on 3 Lesson 5.
40. Fromyour Greenf oot l essons, cl asses can onl y use the methods they have i nheri t ed. They cannot use methods fr omot her cl asses. T(1) Poi nt s
Tr ue
Fal se (*)
Corr ect
Secti on 3
41. From your Gr eenf oot l essons, a probl emst atement def i nes the pur pose f or your game. True or f al se? Mark f or Revi ew(1) Poi nt s
Tr ue ( *)
Fal se
Corr ect
42. Use your Gr eenfoot knowl edge: An arr ay obj ect hol ds a si ngl e var i abl e. True or f al se? Mark for Revi ew(1) Poi nt s
Tr ue
Fal se (*)
Corr ect
43. I n Greenf oot , a l ocal vari abl e i s decl ared at the begi nni ng of a cl ass. True or fal se? Mark f or Revi ew(1) Poi nt s
Tr ue
Fal se (*)
I ncorr ect . Refer t o Sect i on 3 Lesson 10.
44. Fromyour Greenf oot l essons, whi ch of t he f ol l owi ng l ogi c operat ors represents "and"? Mark for Revi ew(1) Poi nt s
&
&& ( *)
=
!
Corr ect
45. Use your Gr eenfoot knowl edge t o answer t he questi on. One r eason to wr i t e a defi ned method i n a cl ass i s t o change t he behavi or o
(1) Poi nt s
Tr ue ( *)
Fal se
Corr ect
Secti on 3
46. To execute a method i n your Gr eenf oot game, where i s i t cal l ed f r om? Mark f or Revi ew(1) Poi nt s
The wor l d
The act method ( *)
The act or cl ass
The gal l ery
Corr ect
47. I n Greenf oot , a way t o have al l subcl asses of a supercl ass i nheri t a method i s by addi ng t he method t o t he supercl ass. True or f(1) Poi nt s
Page 6 of 7
6/1/2014http://programarejava.wikispaces.com/file/view/midsect3+silvia.txt
8/13/2019 Programarejava.wikispaces.com File View Midsect3+Silvia.
http://slidepdf.com/reader/full/programarejavawikispacescom-file-view-midsect3silvia 7/7
True (*)
Fal se
Corr ect
48. We can use t he Actor const r uct or t o automati cal l y creat e Actor i nstances when the Greenf oot worl d i s i ni t i al i zed. True or f al se?(1) Poi nt s
Tr ue
Fal se (*)
I ncorr ect . Refer t o Sect i on 3 Lesson 8.
49. Use your Greenf oot knowl edge t o answer the questi on: Where are def i ned vari abl es t ypi cal l y ent ered i n a cl ass' s source code? M(1) Poi nt s
I n t he def i ned method i n t he source code.
Between t he const r uctors and methods i n the source code.
Af t er t he const r uctor s and methods i n the sour ce code.
At t he t op of t he source code, bef ore t he const r uctor s and methods. ( *)
Corr ect
50. I n Greenf oot , we can use the act method i n the cl ass to aut omati cal l y creat e the Actor i nstances when the worl d i s i ni t i al i zed.(1) Poi nt s
Tr ue
Fal se (*)
Corr ect
Page 7 of 7