Upload
cucutianu-robert
View
220
Download
0
Embed Size (px)
Citation preview
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 1/45
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. n asterisk !"# indicates a correct answer.
To$ of Form
%ection &
!nswer all questions in t'is section#
(. )'ic' of t'e followin* does not describe met'ods+
sub$ro*ram t'at acts on data and often returns a value.
set of code t'at is referred to by name.
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 2/45
an be called at any $oint in a $ro*ram sim$ly by utili-in* its name.
s associated wit' an instance variable. !"#
ncorrect. Refer to %ection & /esson (0.
&. )'at do lines 1 and (( do in t'e followin* code+
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 3/45
cce$t user in$ut and store t'em in t'e variables num( and num&. !"#
%can t'e next $a*e in t'e scanner.
Examine a 2le and scan t'e next line.
3one of t'e above.
ncorrect. Refer to %ection & /esson (0.
4. From your lice lessons, w'ic' of t'e followin* are ty$es of storyboards+
!'oose all correct answers#
ctual
Textual !"#
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 4/45
Factual
5isual !"#
Fictional
ncorrect. Refer to %ection & /esson 6.
0. n lice, w'ic' of t'e followin* is t'e most likely situation w'ere $rocedural abstraction could be used+
Five do*s all need to bark and run at t'e same time. !"#
7ne 2s' needs to swim forward ( meter.
Two 2s' say somet'in* to eac' ot'er.
7ne $erson moves u$ (8 meters.
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 5/45
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 6/45
To$ of Form
%ection &
!nswer all questions in t'is section#
9. )'ic' of t'e followin* does not describe variables+ Mark for Review
!(# oints
$lace in memory w'ere data of a s$eci2c ty$e can be stored for
later retrieval and use.
;as a unique name.
;as a ty$e associated wit' it.
rran*ed in rows and columns. !"#
ncorrect. Refer to %ection & /esson (4.
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 7/45
<. )'ic' of t'e followin* is not a relational o$erator+ Mark for Review
!(# oints
=
>> !"#
?
@
ncorrect. Refer to %ection & /esson (4.
A. n lice, t'e $roceduresB ar*uments allow t'e $ro*rammer to adCust t'e
obCect, motion, distance amount, and time duration. True or false+
Mark for Review
!(# oints
True !"#
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 8/45
False
orrect
1. n lice, t'e set5e'icle $rocedure will associate one obCect to anot'er.
True or false+
Mark for Review
!(# oints
True !"#
False
ncorrect. Refer to %ection & /esson 9.
(8. n lice, a com$uter $ro*ram requires functions to tell it 'ow to $erform
t'e $rocedure. True or false+
Mark for Review
!(# oints
True
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 9/45
False !"#
ncorrect. Refer to %ection & /esson 9.
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. n asterisk !"# indicates a correct answer.
To$ of Form
%ection &
!nswer all questions in t'is section#
((. ll obCects in lice 'ave t'ree dimensional coordinates on w'ic' axes+
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 10/45
!'oose all correct answers#
x !"#
y !"#
- !"#
w
ll of t'e above
ncorrect. Refer to %ection & /esson &.
(&. )'at is t'e 2rst ste$ to $ro*rammin* an obCect to turn left in lice+
%elect t'e duration for t'e obCect to turn.
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 11/45
%elect t'e distance to turn.
%elect t'e obCect to $ro*ram from t'e instance menu. !"#
Dra* t'e turn $rocedure into t'e ode editor.
ncorrect. Refer to %ection & /esson 4.
(4. Functions answer questions about an obCect, suc' as its 'ei*'t, widt', de$t' and even distance to anot'e
True !"#
False
orrect
(0. com$lete lice instruction includes w'ic' of t'e followin* com$onents+
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 12/45
!'oose all correct answers#
ma*e
lass
rocedure !"#
Direction !"#
mount !"#
ncorrect. Refer to %ection & /esson 0.
(6. )'at s'ould you refer to for t'e animationBs desi*n s$eci2cations as you $ro*ram your lice animation+
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 13/45
ode
%cene editor
%toryboard !"#
%cenario
orrect
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. n asterisk !"# indicates a correct answer.
To$ of Form
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 14/45
%ection &
!nswer all questions in t'is section#
(9. From your lice lessons, w'en testin* your animation, you s'ould test t'at comments were added below
True
False !"#
ncorrect. Refer to %ection & /esson (&.
(<. )'ic' of t'e followin* F control structures command t'e blue tan* 2s' to roll and simultaneously move
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 15/45
!"#
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 16/45
ncorrect. Refer to %ection & /esson A.
(A. )'ic' of t'e followin* is not an lice variable value ty$e+
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 17/45
olor
Decimal 3umber
)'ole 3umber
Function !"#
ncorrect. Refer to %ection & /esson (8.
(1. )'ic' of t'e followin* $ro*rammin* instructions commands t'e 2s' to continuously move forward a rand
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 18/45
!"#
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 19/45
orrect
&8. lice uses builtin mat' o$erators t'ey are:
dd and subtract
Multi$ly and divide
ll of t'e above !"#
3one of t'e above
orrect
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 20/45
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. n asterisk !"# indicates a correct answer.
To$ of Form
%ection &
!nswer all questions in t'is section#
&(. n lice, w'ic' of t'e followin* $ro*rammin* statements moves t'e cat backward, 'alf t'e distance to t'
t'is.at move backward Gt'is.Hird *etDistanceTo t'is.at > &I
t'is.at move forward Gt'is.Hird *etDistanceTo t'is.at > &I
t'is.Hird move forward Gt'is.Hird *etDistanceTo t'is.at > &I
t'is.at move backward Gt'is.at *etDistanceTo t'is.Hird > &I !"#
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 21/45
ncorrect. Refer to %ection & /esson 1.
&&. n lice event is considered w'at+
$arty wit' at least &8 $eo$le.
n obCectBs orientation.
Error 'andlin*.
keystroke or mouse click. !"#
ncorrect. Refer to %ection & /esson ((.
%ection 4
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 22/45
!nswer all questions in t'is section#
&4. sin* t'e Kreenfoot DE, w'en is a constructor automatically executed+
)'en source code is written.
)'en a new ima*e is added to t'e class.
)'en a new instance of t'e class is created. !"#
)'en t'e act met'od is executed.
ncorrect. Refer to %ection 4 /esson A.
&0. sin* Kreenfoot, 'ow do we c'an*e t'e si-e and resolution of t'e )orld instance+
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 23/45
Edit t'e met'ods in t'e class.
Edit t'e values in t'e constructor. !"#
Delete t'e instance.
Edit t'e values in t'e classBs act met'od.
orrect
&6. n Kreenfoot, an ifstatement is used to alternate between dis$layin* two ima*es in an instance. True or f
True
False !"#
ncorrect. Refer to %ection 4 /esson A.
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 24/45
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. n asterisk !"# indicates a correct answer.
To$ of Form
%ection 4
!nswer all questions in t'is section#
&9. n t'e Kreenfoot DE, w'ic' of t'e followin* are com$onents of a $arameter+
!'oose all correct answers#
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 25/45
arameter ty$e !"#
arameter return
arameter name !"#
arameter met'od
arameter void
ncorrect. Refer to %ection 4 /esson &.
&<. From your Kreenfoot lessons, to view t'e met'ods t'at a class in'erits, o$en t'e code editor and select d
True !"#
False
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 26/45
ncorrect. Refer to %ection 4 /esson &.
&A. From your Kreenfoot lessons, instances do not 'ave any memory. True or false+
True
False !"#
ncorrect. Refer to %ection 4 /esson &.
&1. )'at ty$e of Kreenfoot met'od would be used to turn an obCect+
orientTo! #
turnround! #
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 27/45
move ! #
turn! # !"#
ncorrect. Refer to %ection 4 /esson &.
48. From your Kreenfoot lessons, a $roblem statement de2nes t'e $ur$ose for your *ame. True or false+
True !"#
False
orrect
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 28/45
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. n asterisk !"# indicates a correct answer.
To$ of Form
%ection 4
!nswer all questions in t'is section#
4(. )'ic' of t'e followin* ty$e of audience s'ould you ask to $lay your Kreenfoot *ame durin* t'e testin* $
Testin*
Tar*et !"#
rimary
ro*rammer
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 29/45
orrect
4&. se you Kreenfoot knowled*e: )'at ran*e of numbers does t'e followin* met'od return+
Kreenfoot.*etRandom3umber!48#
random number between ( and 48.
random number between 8 and 48.
random number between 8 and &1. !"#
random number between ( and &1.
ncorrect. Refer to %ection 4 /esson 6.
44. From your Kreenfoot lessons, w'ic' of t'e followin* is not a c'aracteristic of a static met'od+
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 30/45
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 31/45
ncorrect. Refer to %ection 4 /esson 6.
46. From your Kreenfoot lessons, a com$arison o$erator returns w'at value w'en a number meets its require
8
57D
( !"#
3//
ncorrect. Refer to %ection 4 /esson 6.
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 32/45
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. n asterisk !"# indicates a correct answer.
To$ of Form
%ection 4
!nswer all questions in t'is section#
49. From your Kreenfoot lessons, t'e keyDown met'od is located in w'ic' class+
ctor
Kreenfoot !"#
Kreenfootma*e
)orld
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 33/45
orrect
4<. n Kreenfoot, only (8 met'ods can be written for eac' class in t'e ode editor. True or false+
True
False !"#
ncorrect. Refer to %ection 4 /esson 4.
4A. From your Kreenfoot lessons, in an ifstatement, t'e $ro*rammin* statements written in curly brackets ar
True
False !"#
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 34/45
orrect
41. n Kreenfoot, de2ned met'ods must be used immediately. True or false+
True
False !"#
ncorrect. Refer to %ection 4 /esson 9.
08. From your Kreenfoot lessons, 'ow do you call a de2ned met'od+
all t'e met'od from t'e act met'od. !"#
all t'e met'od from t'e de2ned met'od.
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 35/45
)rite t'e met'od in t'e )orld su$erclass.
)rite t'e met'od in t'e instance.
)rite t'e met'od in t'e source code.
ncorrect. Refer to %ection 4 /esson 9.
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. n asterisk !"# indicates a correct answer.
To$ of Form
%ection 4
!nswer all questions in t'is section#
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 36/45
0(. n Kreenfoot, in w'ic' $ro*rammin* task are t'e obCects identi2ed+
De2ne t'e $roblem.
Desi*n t'e solution.
ro*ram t'e solution. !"#
Test t'e solution.
orrect
0&. From your Kreenfoot lessons, w'ic' of t'e followin* are exam$les of L> test variations+
'an*e t'e environment.
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 37/45
'an*e t'e execution.
'an*e t'e data.
ll of t'e above. !"#
ncorrect. Refer to %ection 4 /esson (&.
04. n Kreenfoot, t'e ima*e below is an exam$le of w'at construct+
Met'od
onditional !"#
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 38/45
5ariable ssi*nment
lass
ncorrect. Refer to %ection 4 /esson (&.
00. From your Kreenfoot lessons, t'e reset button resets t'e scenario back to its initial $osition. True or false+
True !"#
False
orrect
06. )'ic' of t'e followin* Java syntax is used to correctly create a Duke subclass+
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 39/45
$rivate Do* extends )orld
$ublic class Do* extends )orld
$ublic class Duke extends nimal !"#
$rivate class extends ctor
$rivate class extends Duke
ncorrect. Refer to %ection 4 /esson (.
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. n asterisk !"# indicates a correct answer.
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 40/45
To$ of Form
%ection 4
!nswer all questions in t'is section#
09. se your Kreenfoot knowlde*e: bstraction occurs in many dierent ways in $ro*rammin*. True or false+
True !"#
False
ncorrect. Refer to %ection 4 /esson 1.
0<. From your Kreenfoot lessons, w'ic' of t'e followin* lo*ic o$erators re$resents NandN+
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 41/45
O
OO !"#
@
P
ncorrect. Refer to %ection 4 /esson (8.
0A. n Kreenfoot, w'at 'a$$ens if t'e end to a w'ile loo$ isnBt establis'ed+
T'e code will kee$ executin* and will never sto$. !"#
T'e code will execute once and t'en sto$, due to controls in Kreenfoot.
T'e code will $rom$t you to enter a loo$ counter.
T'e code will not execute.
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 42/45
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 43/45
@ (88 S i
i@(
i @ i
i @ i S ( !"#
ncorrect. Refer to %ection 4 /esson (8.
a*e (8 of (8
Hottom of Form
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 44/45
8/18/2019 Test.oracle Acad( M IRSYAD)
http://slidepdf.com/reader/full/testoracle-acad-m-irsyad 45/45