Test JAVA Fundamentals Midterm Exam
Test JAVA Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct
answer.
Section 2
(Answer all questions in this section)
1In Alice, procedural abstraction is the concept of making code easier to
. understand and reuse. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
2In Alice, if a procedure is declared for a clownFish class, which classes
. can use the procedure?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Visual storyboard
Flowchart (*)
Pie chart
Scene editor
Class chart
Mark for
Review
(1) Points
getObject
getDuration
getDepth
getDistance (*)
Incorrect. Refer to Section 2 Lesson 7.
5Which of the following statements about what happens when the
. following code is executed is false?
Mark for
Review
(1) Points
different
message
to display
if the
user is 18
or older,
what type
of
construct
would
you use?
for all loop
do loop
while loop
if (*)
Incorrect. Refer to Section 2 Lesson
14.
7. The Alice IF control structure requires the false statement to
be populated. True or false?
True
False (*)
Correct
8. In Alice, Do In Order and Do Together:
True (*)
False
Incorrect. Refer to Section 2 Lesson
6.
10. Which of the following actions would require a control
statement to control animation timing?
12. From your Alice lessons, variables are fixed and cannot be changed.
True or false?
Mark for
Review
(1) Points
True
False (*)
Correct
13. Which of the following programming instructions commands the fish
to continuously move forward a random speed between 0.5 and 1.0
meters, minus 0.25 meters, until it collides with the shark?
(*)
Mark for
Review
(1) Points
Correct
14. From your Alice lessons, what does the Count control statement do?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True
False (*)
Correct
Section 2
(Answer all questions in this section)
16.From your Alice lessons, at what point in the animation process do
you confirm the items on the "Checklist for Animation Completion"?
True
False (*)
Incorrect. Refer to Section 2 Lesson 3.
18.From your Alice lessons, complete the following sentence: When
coded, an event triggers a ___________.
Infinite loop
Gallery
Procedure (*)
Scene
Correct
19.In Alice, which of the following programming statements moves the
butterfly forward, double the distance to the tree?
this.Fish - 2}
this.Rock move forward {this.Rock getDistanceTo this.Fish this.Fish - 2}
Correct
2Examine the following code. What are the variables?
1.
Mark for
Review
(1) Points
/
*
%
None of the above
(*)
Corre
ct
Section 3
(Answer all questions in this section)
23. From your Greenfoot
lessons, source code is
written in the Code
editor. True or false?
Mark for
Review
(1) Points
True (*)
False
Corre
ct
24. In Greenfoot, what
happens if the
condition is false in an
if-statement?
The programming
statements are
executed.
The if-statement is
executed.
The act method is
deleted.
The programming
statements are not
executed. (*)
Corre
ct
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True
False (*)
Incorr
ect.
Refer
to
Sectio
n3
Lesso
n6
Mark for Review
26.From
your
Greenfoot
lessons,
how do
you call a
defined
method?
(1) Points
Mark for
Review
(1) Points
Testing
Target (*)
Primary
Programmer
Incorrect. Refer to Section 3 Lesson
4.
28. From your Greenfoot lessons, a problem statement defines
the purpose for your game. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
29. Using Greenfoot, how do we change the size and resolution
of the World instance?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True
False (*)
Correct
31.Using the
Greenfoot
IDE, when is
a constructor
automatically
executed?
Mark for
Review
(1) Points
Methods
Classes
Integers (*)
Scenarios
Incorrect. Refer to Section 3
Lesson 2.
33. In Greenfoot, the properties of an instance can be
modified in the documentation. True or false?
Mark for
Review
(1) Points
True
False (*)
Incorrect. Refer to Section 3
Lesson 2.
34. From your Greenfoot lessons, which of the following are
properties of an instance?
Mark for
Review
(1) Points
Size
Color
Image file
Methods
All of the above (*)
Mark for
Review
(1) Points
void turnLeft()
()
void
turnLeft (*)
Left
Correct
36.From your
Greenfoot
lessons,
which of the
following is
not a
characteristic
of a static
method?
Mark for
Review
(1) Points
38. When a Greenfoot code segment is executed in an ifstatement, each line of code is executed in sequential
order. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
39. In Greenfoot, you can use comparison operators to
compare a variable to a random number. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
40. From your Greenfoot lessons, the keyDown method is
located in which class?
Mark for
Review
(1) Points
Actor
Greenfoot (*)
GreenfootImage
World
Correct
41.From
your
Greenfoot
lessons,
which of
the
following
is not a
step to
creating a
new
subclass?
Right-click on a superclass.
Click New subclass...
Name the class.
Select an image for the class.
Program the class to move forward. (*)
Incorrect. Refer to Section 3 Lesson
1.
42. From your Greenfoot lessons, a scenario is a game or
simulation implemented in Greenfoot. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
43. How would the following sentence be written in Greenfoot
source code? If Duke's leg is down, and the keyboard key "d"
is down...
Mark for
Review
(1) Points
if (&&isDown ! Greenfoot.isKeyDown("d") )
if (!isDown && Greenfoot.isKeyDown("d") )
if (isDown && Greenfoot.isKeyDown("d") ) (*)
if (!Greenfoot.isKeyDown && isDown("d") )
Correct
44. From your Greenfoot lessons, what is a loop?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Mark for
Review
(1) Points
keynames[2]
keynames["a"]
keynames[0] (*)
keynames["a" key]
Correct
4From your Greenfoot lessons, which line of code is missing something?
7.
Mark for
Review
(1) Points
1
3 (*)
4
5
6
Correct
4In Greenfoot, the image below is an example of what construct?
8.
Mark for
Review
(1) Points
Method
Comment
Constructor (*)
Class
Incorrect. Refer to Section 3 Lesson 12.
4Use your Greenfoot skills to answer the question. What is incorrect in this
9.code?
Mark for
Review
(1) Points
Spacing missing
Curly brace missing
Parenthesis missing (*)
Comma missing
Correct
Mark for
Review
(1) Points