Friday, 13 January 2017 Section 2 Oracle Java Fundamentals Quiz Section 2 - Quiz 1 L1-L7 (Answer all questions in this section) 1. In Alice, which control statement is used to ino!e simultaneous moement" $or %eiew (1) &oints 'o In rder ount 'o *o+ether () hile aria/le
#ar!
2. In Alice, a com0uter 0ro+ram requires $unctions to tell it how to 0er$orm the 0rocedure. *rue or $alse" #ar! $or %eiew (1) &oints *rue alse () . #anuall3 mani0ulatin+ an Alice o/4ect with 3our cursor is a wa3 to 0recisel3 0osition an o/4ect. *rue or $alse" #ar! $or %eiew (1) &oints *rue alse () 5. nl3 actin+ o/4ects hae one-shot 0rocedures. *rue or $alse" (1) &oints *rue alse () 6. In Alice, where are o/4ects added and 0ositioned in the scene" (1) &oints *he tem0late *he Scene editor () *he ode editor *he +aller3
#ar! $or %eiew
#ar! $or %eiew
. 8e$ore 3ou can /e+in to deelo0 the animation stor3/oard, what must /e de$ined" #ar! $or %eiew (1) &oints *he de/u++in+ 0rocess *he control statements
*he code *he scenario () 7. In Alice, which o$ the $ollowin+ are /ene$its o$ se0aratin+ out motions into their own 0rocedures" #ar! $or %eiew (1) &oints (hoose all correct answers) It ma!es the scene easier to iew. It can allow su/classes o$ a su0erclass to use a 0rocedure. () It sim0li$ies code and ma!es it easier to read. () It ma!es the animation easier to run. It allows man3 o/4ects o$ a class to use the same 0rocedure. () 9. hich Alice tool is used to demonstrate the 0rocess $low o$ an animation" #ar! $or %eiew (1) &oints orld &ie chart *e:tual stor3/oard isual stor3/oard lowchart () ;.
hich Alice e:ecution tas! corres0onds with the $ollowin+ stor3/oard statement"
at turns to $ace mouse. #ar! $or %eiew (1) &oints mouse turn*o cat this.cat turn*oace this.mouse () this.mouse turn*oace this.cat cat *urn*o mouse 1<. rom 3our Alice lessons, which control statement e:ecutes instructions simultaneousl3" #ar! $or %eiew (1) &oints 'o in order aria/le 'o to+ether () ount 11. rom 3our Alice lessons, /uilt-in $unctions 0roide 0recise 0ro0ert3 details $or the $ollowin+ areas= #ar! $or %eiew (1) &oints &ro:imit3 and 0oint o$ iew. 'istance to and nestin+. &ro:imit3 and size. &ro:imit3, size, s0atial relation, and 0oint o$ iew. ()
12. rom 3our Alice lessons, which 0ro+rammin+ instruction re0resents the $ollowin+ moement= A turtle moes $orward hal$ the distance to the $lower. #ar! $or %eiew (1) &oints this.*urtle moe orward this.*urtle +et'istance*o this.lower 2 this.*urtle moe orward this.*urtle +et'istance*o this.lower > 1.< this.*urtle moe orward this.*urtle +et'istance*o this.lower > <.6 this.*urtle moe orward this.*urtle +et'istance*o this.lower > 2.< () 1. hat is the 0ur0ose o$ a $unction in Alice" #ar! $or %eiew (1) &oints *o 0osition the o/4ect in the Scene editor. *o sae the 0ro4ect. *o com0ute and answer a question a/out an o/4ect. () *o de$ine how the o/4ect should e:ecute a tas!. 15. *he comments 3ou enter in Alice should descri/e the sequence o$ actions that ta!e 0lace in the code se+ment. *rue or $alse" #ar! $or %eiew (1) &oints *rue () alse 16. hich o$ the $ollowin+ is a reason wh3 3ou mi+ht disa/le 0ro+rammin+ statements in 3our Alice code" #ar! $or %eiew (1) &oints *o disa/le the entire 0ro+ram. *o ma!e an o/4ect moe $orward. *o ma!e an o/4ect turn and moe simultaneousl3. *o hel0 isolate 0ortions o$ code durin+ testin+. ()
1. rom 3our Alice lessons, where on an o/4ect do an o/4ect?s a:es intersect" #ar! $or %eiew (1) &oints At the o/4ect?s center 0oint () At the o/4ect?s head At the o/4ect?s chest At the o/4ect?s /ottom 2. nl3 actin+ o/4ects hae one-shot 0rocedures. *rue or $alse" (1) &oints *rue alse ()
#ar! $or %eiew
. In Alice, which o$ the $ollowin+ is not a control statement" #ar! $or %eiew (1) &oints ount #oe () hile 'o In rder 5. In Alice, a com0uter 0ro+ram requires $unctions to tell it how to 0er$orm the 0rocedure. *rue or $alse" #ar! $or %eiew (1) &oints *rue alse () 6. hen is an instance created in Alice" #ar! $or %eiew (1) &oints A$ter the scenario is saed. A$ter the $older is selected in the +aller3. A$ter the class icon is dra++ed into the scene. () A$ter the code is created. . hich o$ the $ollowin+ is an e:am0le o$ nestin+ in an Alice 0ro+ram" #ar! $or %eiew (1) &oints ie 'o *o+ether statements are nested inside o$ a 'o In rder statement. () A moe 0rocedure is nested inside o$ a turn 0rocedure. 'istance, duration, and direction ar+uments are nested inside o$ a 0rocedure. *e:t is nested inside o$ a comments tile. 7. hich Alice control statement e:ecutes a set o$ 0rocedures simultaneousl3" $or %eiew (1) &oints 'o in order hile
#ar!
*o+ether 'o to+ether ()
9. &ro+rammin+ comments do not a$$ect the $unctionalit3 o$ 3our Alice animation. *rue or $alse" #ar! $or %eiew (1) &oints *rue () alse ;. hat is the $irst ste0 to enterin+ comments in an Alice 0ro+ram" #ar! $or %eiew (1) &oints Select the instance $rom the instance menu. 'ra+ and dro0 the comments tile /elow a code se+ment. *30e comments that descri/e the sequence o$ actions in the code se+ment. 'ra+ and dro0 the comments tile a/oe a code se+ment. () 1<. In Alice the unctions ta/ will dis0la3 the 0re-de$ined $unctions $or the selected instance. *rue or $alse" #ar! $or %eiew (1) &oints *rue () alse 11. In Alice, what $unction would 3ou use to +et a wholenum/er $rom the user" $or %eiew (1) &oints +etInte+errom@ser () +et8ooleanrom@ser +etStrin+rom@ser +et'ou/lerom@ser
#ar!
12. In Alice, there is no wa3 o$ reorderin+ the $unction list in the $unction ta/. *rue or $alse" #ar! $or %eiew (1) &oints *rue alse () 1. 'e$inin+ the scenario, and the Alice animation to re0resent the scenario, is the $irst ste0 to 0ro+rammin+ 3our animation. *rue or $alse" #ar! $or %eiew (1) &oints *rue () alse 15. In Alice, declarin+ a new 0rocedure to shorten code and ma!e it easier to read is a 0rocedural a/straction technique. *rue or $alse" #ar! $or %eiew (1) &oints *rue ()
alse
16. In Alice, what are the $orms o$ a scenario" #ar! $or %eiew (1) &oints (hoose all correct answers) A 0ro/lem to sole. () A tas! to 0er$orm. () A 0erson to hel0. A s3stem to start. A section o$ code to write.
1. 8e$ore 3ou can /e+in to deelo0 the animation stor3/oard, what must /e de$ined" #ar! $or %eiew (1) &oints *he de/u++in+ 0rocess *he control statements *he scenario () *he code 2. In Alice, declarin+ a new 0rocedure to shorten code and ma!e it easier to read is a 0rocedural a/straction technique. *rue or $alse" #ar! $or %eiew (1) &oints *rue () alse . A scenario +ies the Alice animation a 0ur0ose. *rue or $alse" (1) &oints *rue () alse
#ar! $or %eiew
5. rom 3our Alice lessons, which 0ro+rammin+ instruction re0resents the $ollowin+ moement= A cat moes $orward dou/le (or twice) the distance to the tree. #ar! $or %eiew (1) &oints this.at moe orward this.at +et'istance*o this.tree > 2.< this.at moe orward this.at +et'istance*o this.tree - 2.< this.at moe orward this.at +et'istance*o this.tree 2.< () this.at moe $orward this.at +et'istance*o this.tree 2.< 6. In Alice, where 3ou would 3ou +et access to the s0eci$ic 4oints o$ an o/4ect that are not aaila/le throu+h the o/4ect dro0 down menu" #ar! $or %eiew (1) &oints scene editor 0rocedures ta/ $unctions ta/ () code editor . nl3 actin+ o/4ects hae one-shot 0rocedures. *rue or $alse" (1) &oints *rue alse ()
#ar! $or %eiew
7. rom 3our Alice lessons, where on an o/4ect do an o/4ect?s a:es intersect" #ar! $or %eiew (1) &oints At the o/4ect?s /ottom At the o/4ect?s chest At the o/4ect?s head
At the o/4ect?s center 0oint () 9.
hich Alice e:ecution tas! corres0onds with the $ollowin+ stor3/oard statement"
at turns to $ace mouse. #ar! $or %eiew (1) &oints this.cat turn*oace this.mouse () mouse turn*o cat cat *urn*o mouse this.mouse turn*oace this.cat ;. In Alice, the com0uter s0eci$ies the low and hi+h ran+e alues $or the ran+e o$ num/ers $rom which to 0ull a randomized num/er. *rue or $alse" #ar! $or %eiew (1) &oints *rue alse () 1<. hen somethin+ is /ro!en or doesn?t wor! as intended in a so$tware 0ro+ram, it is re$erred to as a BBBBBBBBB" #ar! $or %eiew (1) &oints 8u+ () Crror ode 'e/u+ 11. 'e/u++in+ and testin+ is the 0rocess o$ runnin+ the animation one time, and ad4ustin+ the control statements, 0rocedures, and ar+uments. #ar! $or %eiew (1) &oints *rue alse () 12. In Alice the unctions ta/ will dis0la3 the 0re-de$ined $unctions $or the selected instance. *rue or $alse" #ar! $or %eiew (1) &oints *rue () alse 1. hat is the $irst ste0 to 0ro+rammin+ an o/4ect to turn le$t in Alice" %eiew (1) &oints Select the o/4ect to 0ro+ram $rom the instance menu. () 'ra+ the turn 0rocedure into the ode editor. Select the duration $or the o/4ect to turn. Select the distance to turn.
#ar! $or
15. In Alice, the 0rocedures? ar+uments allow the 0ro+rammer to ad4ust the o/4ect, motion, distance amount, and time duration. *rue or $alse" #ar! $or %eiew (1) &oints *rue () alse 16. hich o$ the $ollowin+ actions would require a control statement to control animation timin+" #ar! $or %eiew (1) &oints (hoose all correct answers) A /i0ed o/4ect wal!in+. () A roc! o/4ect turnin+. A /ird $l3in+. () A $ish swimmin+. ()
1. 'e$ine the alue o$ the aria/le La0ount /ased on the $ollowin+ math calculation= La0ount 1< D 16 #ar! $or %eiew (1) &oints 2 16 5 6 () 1< 2. hich o$ the $ollowin+ is not an Alice aria/le alue t30e" #ar! $or %eiew (1) &oints hole Eum/er 'ecimal Eum/er olor unction () . In Alice, what are the $orms o$ a scenario" #ar! $or %eiew (1) &oints (hoose all correct answers) A 0ro/lem to sole. () A 0erson to hel0. A tas! to 0er$orm. () A section o$ code to write. A s3stem to start. 5. rom 3our Alice lessons, animations should /e tested /3 the 0ro+rammer /e$ore the3 are considered com0lete. *rue or $alse" #ar! $or %eiew (1) &oints *rue () alse 6. rom 3our Alice lessons, when testin+ 3our animation, 3ou should test that comments were added /elow each sequence o$ instructions in the code. *rue or $alse" #ar! $or %eiew (1) &oints *rue alse () . In Faa, a $unction is a method that must return a alue. *rue or $alse" %eiew (1) &oints *rue alse () 7. hich o$ the $ollowin+ does not descri/e methods" #ar! $or %eiew (1) &oints A su/0ro+ram that acts on data and o$ten returns a alue.
#ar! $or
A set o$ code that is re$erred to /3 name. Is associated with an instance aria/le. () an /e called at an3 0oint in a 0ro+ram sim0l3 /3 utilizin+ its name. 9. In Alice, we can aoid o/4ect collision usin+ what" #ar! $or %eiew (1) &oints 'ownloadin+ the Alice collision detector a00. @sin+ o/4ect detection. @sin+ math o0erators. () Slowin+ moements down. ;. Alice uses /uilt-in math o0eratorsG the3 are= #ar! $or %eiew (1) &oints Add and su/tract #ulti0l3 and diide All o$ the a/oe () Eone o$ the a/oe 1<. In Alice, what ta/ would 3ou choose to start a new animation with a 0re-0o0ulated world" #ar! $or %eiew (1) &oints %ecent 8lan! Slate Starters () #3 &ro4ects 11. In Alice, when is the sceneActiationListener e:ecuted" (1) &oints hen the user clic!s on on o/4ect At the end o$ the animation At the /e+innin+ o$ the animation () hen an o/4ect a00ears on screen
#ar! $or %eiew
12. A data t30e de$ines the t30e o$ 0rocedures a aria/le can store. *rue or $alse" $or %eiew (1) &oints *rue alse ()
#ar!
1. I$ a alue has /een assi+ned to (is stored in) a aria/le, that alue will /e oerwritten when another alue is assi+ned to the aria/le usin+ the assi+nment HDH o0erator. *rue or $alse" #ar! $or %eiew (1) &oints *rue () alse
15. In Alice, the use o$ conditional control structures allows what two t30es o$ loo0s" #ar! $or %eiew (1) &oints (hoose all correct answers) switch to+ether conditional () in$inite 16. In Alice, which one o$ the $ollowin+ is not a 0re-de$ined control structure" #ar! $or %eiew (1) &oints do in order do to+ether do while () while
1. In Faa, which s3m/ol is used to assi+n one alue to another" #ar! $or %eiew (1) &oints D () J >> 2. hat is the out0ut 0roduced /3 the $ollowin+ code" #ar! $or %eiew (1) &oints
4 is 1< 4 is 6 ! is 6 4 is 6 ! is 6 () 4 is 1< ! is 1< 4 is 16 ! is 16 . hen 3ou want s0eci$ic code to /e e:ecuted onl3 i$ certain conditions are met, what t30e o$ Faa construct would 3ou use" #ar! $or %eiew (1) &oints i$ () arra3 while loo0 /oolean 5. I$ 3ou need to re0eat a +rou0 o$ Faa statements man3 times, which Faa construct should 3ou use" #ar! $or %eiew (1) &oints
(hoose all correct answers) while loo0 () do while loo0 () re0eat...until i$ 6. In Alice it is not 0ossi/le to trans$er a class $rom one animation to another. *rue or $alse" #ar! $or %eiew (1) &oints *rue alse () . Kou want an eent to ha00en when an o/4ect collides with another o/4ect, which cate+or3 o$ eent handler would 3ou choose" #ar! $or %eiew (1) &oints e3/oard #ouse Scene Actiation>time &osition>rientation () 7. hich o$ the $ollowin+ is not an Alice aria/le alue t30e" #ar! $or %eiew (1) &oints olor 'ecimal Eum/er unction () hole Eum/er 9. *he initializer o$ a aria/le with a *e:tStrin+ alue t30e could /e (select all that a00l3)= #ar! $or %eiew (1) &oints (hoose all correct answers) HMreetin+sH () HNowd3H () H5H () Eone o$ the a/oe. ;. hich o$ the $ollowin+ NILC control structures commands the $ish to moe $orward re0eatedl3 <.6 meters at a time, /ut sto0 i$ it collides with the shar!" #ar! $or %eiew (1) &oints
()
1<. In Alice, we use the NILC control statement to im0lement the conditional loo0. *rue or $alse" #ar! $or %eiew (1) &oints *rue () alse 11. In Alice, which o$ the $ollowin+ 0ro+rammin+ statements moes the /utter$l3 $orward, dou/le the distance to the tree" #ar! $or %eiew (1) &oints this.8utter$l3 moe $orward Othis.8utter$l3 +et'istance*o this.*ree > 2P this.8utter$l3 moe /ac!ward Othis.8utter$l3 +et'istance*o this.*ree 2P this.8utter$l3 moe $orward Othis.8utter$l3 +et'istance*o this.*ree 2P () this.8utter$l3 moe /ac!ward Othis.8utter$l3 +et'istance*o this.*ree > 2P 12. An e:am0le o$ an e:0ression is= #ar! $or %eiew (1) &oints I$ or here D; () #oe $orward 1 meter HI $eel ha003.H 1. rom 3our Alice lessons, a te:tual stor3/oard 0roides a detailed, ordered list o$ the actions each o/4ect 0er$orms in each scene o$ the animation. *rue or $alse" #ar! $or %eiew (1) &oints *rue () alse 15. rom 3our Alice lessons, when testin+ 3our animation, 3ou should test that comments were added /elow each sequence o$ instructions in the code. *rue or $alse" #ar! $or %eiew (1) &oints *rue alse () 16. hat can /e used as a +uideline to ensure 3our Alice animation $ul$ills animation 0rinci0les" #ar! $or %eiew (1) &oints An animation chec!list () ther 0ro+rammers *he Internet A close $riend
1. An eent is an3 action initiated /3 the user that is desi+ned to in$luence the 0ro+ram メ s e:ecution durin+ 0la3. #ar! $or %eiew (1) &oints *rue () alse 2. In Alice, what ta/ would 3ou choose to start a new animation with a 0re-0o0ulated world" #ar! $or %eiew (1) &oints %ecent Starters () #3 &ro4ects 8lan! Slate . hich o$ the $ollowin+ is not a alid arithmetic o0erator in Faa" (1) &oints > R () Eone o$ the a/oe
#ar! $or %eiew
5. I$ a alue has /een assi+ned to (is stored in) a aria/le, that alue will /e oerwritten when another alue is assi+ned to the aria/le usin+ the assi+nment HDH o0erator. *rue or $alse" #ar! $or %eiew (1) &oints *rue () alse 6. In Faa, a $unction is a method that must return a alue. *rue or $alse" %eiew (1) &oints *rue alse ()
#ar! $or
. *he list /elow contains method descri0tions. All are correct e:ce0t which one" $or %eiew (1) &oints (hoose all correct answers) Is associated with an instance aria/le. A su/0ro+ram that acts on data and o$ten returns a alue. () A set o$ code that is re$erred to /3 name. () an /e called at an3 0oint in a 0ro+ram sim0l3 /3 utilizin+ its name.
#ar!
7. In Alice, we can aoid o/4ect collision usin+ what" #ar! $or %eiew (1) &oints 'ownloadin+ the Alice collision detector a00. @sin+ math o0erators. () @sin+ o/4ect detection. Slowin+ moements down. 9. Alice uses /uilt-in math o0eratorsG the3 are= #ar! $or %eiew (1) &oints Add and su/tract #ulti0l3 and diide All o$ the a/oe () Eone o$ the a/oe ;. 'e$ine the alue o$ the aria/le La0ount /ased on the $ollowin+ math calculation= La0ount 1< D 16 #ar! $or %eiew (1) &oints 2 6 () 16 5 1< 1<. *he initializer o$ a aria/le with a *e:tStrin+ alue t30e could /e (select all that a00l3)= #ar! $or %eiew (1) &oints (hoose all correct answers) HMreetin+sH () HNowd3H () H5H () Eone o$ the a/oe. . *he list /elow contains method descri0tions. All are correct e:ce0t which one" $or %eiew (1) &oints (hoose all correct answers) Is associated with an instance aria/le. A su/0ro+ram that acts on data and o$ten returns a alue. () A set o$ code that is re$erred to /3 name. () an /e called at an3 0oint in a 0ro+ram sim0l3 /3 utilizin+ its name. 7. In Alice, we can aoid o/4ect collision usin+ what" #ar! $or %eiew (1) &oints 'ownloadin+ the Alice collision detector a00. @sin+ math o0erators. () @sin+ o/4ect detection.
#ar!
Slowin+ moements down. 9. Alice uses /uilt-in math o0eratorsG the3 are= #ar! $or %eiew (1) &oints Add and su/tract #ulti0l3 and diide All o$ the a/oe () Eone o$ the a/oe ;. 'e$ine the alue o$ the aria/le La0ount /ased on the $ollowin+ math calculation= La0ount 1< D 16 #ar! $or %eiew (1) &oints 2 6 () 16 5 1< 1<. *he initializer o$ a aria/le with a *e:tStrin+ alue t30e could /e (select all that a00l3)= #ar! $or %eiew (1) &oints (hoose all correct answers) HMreetin+sH () HNowd3H () H5H () Eone o$ the a/oe. 16. *he Alice I$ control structure requires the $alse statement to /e 0o0ulated. *rue or $alse" #ar! $or %eiew (1) &oints *rue alse ()