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)
1. The first step to using a top-down approach to programming is to create a ta
True
False (*)
Incorrect. Refer to Section 2 Lesson 4.
2. In Alice, the procedures' arguments allow the programmer to adjust the obje
True (*)
False
Correct
3. In Alice, Do In Order and Do Together:
Are move statements
Are control statements (*)
Are complex statements
None of the above
Incorrect. Refer to Section 2 Lesson 6.
4. In Alice, a computer program requires functions to tell it how to perform the
True
False (*)
Correct
5. Which of the following statements about methods is false?
Classes must be defined directly within a met
Methods whose return type is not void are req
The order in which methods are listed within
Java does not permit nesting one method defi
Incorrect. Refer to Section 2 Lesson 14.
Page 1 of 10
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)
6. When you want specific code to be executed only if certain condi
while loop
if (*)
array
boolean
Correct
7. From your Alice lessons, if you examined a science process that h
1. Present the problem as an anim
2. Further refine and define the ta
3. Identify the high level steps for
1. Identify the detailed steps for th
2. Present the problem as an anim
1. Present the problem as an anim
1. Identify the high level steps for
2. Further refine and define the ta
3. Present the problem as an anim
Correct
8. From your Alice lessons, functional decomposition is the process
True
False (*)
Correct
9. From your Alice lessons, inheritance means that the superclass in
True
False (*)
Incorrect. Refer to Section 2 L
10. In Alice, objects inherit the characteristics of their:
Code
Project
Class (*)
Program
Correct
Page 2 of 10
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)
11. In Alice, procedural abstraction is the concept of making code eas
True (*)
False
Correct
12. An Alice event is considered what?
A party with at least 20 people.
An object's orientation.
Error handling.
A keystroke or mouse click. (*)
Correct
13. In Alice, functions are dragged into the control statement, not the
True
False (*)
Correct
14. Which of the following is not a relational operator?
<
// (*)
>
=
Correct
15. Which of the following is not a valid arithmetic operator in Java?
+
/
*
%
None of the above (*)
Correct
Page 3 of 10
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)
16. In Alice, each class has a set of pre-defined procedures and functi
True (*)
False
Incorrect. Refer to Section 2 L
17. A loop can be infinite (continue forever) or conditional (stops upo
True (*)
False
Correct
18. From your Alice lessons, what is a one-shot procedural method?
A procedure that is invoked when
A procedure that is used to make a
A procedure that is dragged into t
A procedure that is used to launch
Correct
19. Identify an example of an Alice expression.
"I feel happy."
If or Where
3x3=9 (*)
None of the above
Incorrect. Refer to Section 2 L
20. In Alice, we can avoid object collision using what?
Slowing movements down.
Using math operators. (*)
Downloading the Alice 3 collision
Using object detection.
Correct
Page 4 of 10
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)
21. A variable is a named location inside the computer's memory; onc
True (*)
False
Correct
22. From your Alice lessons, variables are fixed and cannot be chang
True
False (*)
Correct
Section 3
(Answer all questions in this section)
23. What type of parameter does the Greenfoot playSound method ex
name of a sound file (as String) (*
name of an integer (as int)
name of a keyboard key (as String
name of the class (as String)
Correct
24. Use your Greenfoot knowledge to answer the question: String con
True (*)
False
Correct
25. From your Greenfoot lessons, which symbol represents string con
Symbol &
Symbol <
Symbol =
Symbol + (*)
Correct
Page 5 of 10
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 3
(Answer all questions in this section)
26. From your Greenfoot lessons, which of the following logic opera
&
&& (*)
=
!
Correct
27. From your Greenfoot lessons, what types of values cannot be stor
(Choose all correct answers)
Class name
Objects
Integers
World name
method (*)
Correct
28. From your Greenfoot lessons, which of the following is not a step
Right-click on a superclass.
Click New subclass...
Name the class.
Select an image for the class.
Program the class to move forwar
Correct
29. In Greenfoot, you must first create an instance before you create a
True
False (*)
Incorrect. Refer to Section 3 L
30. From your Greenfoot lessons, how do you test that your code doe
Write the code.
Inspect the instances.
Review the documentation.
Compile the code. (*)
Correct
Page 6 of 10
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 3
(Answer all questions in this section)
31. From your Greenfoot lessons, a problem statement defines the pu
True (*)
False
Correct
32. From your Greenfoot lessons, what can methods belong to?
(Choose all correct answers)
Galleries
Classes (*)
Scenarios
Objects (*)
All of the above
Correct
33. From your Greenfoot lessons, which programming statement crea
addObject (new Duke( ), 120, 100
addClass (new Duke( ), 120, 100)
addWorld (new Duke( ), 120, 100
Move(120,100);
Correct
34. From your Greenfoot lessons, dot notation allows you to use a me
True (*)
False
Correct
35. Use you Greenfoot knowledge: What range of numbers does the f
Greenfoot.getRandomNumber(30)
A random number between 1 and
A random number between 0 and
A random number between 0 and
A random number between 1 and
Correct
Page 7 of 10
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 3
(Answer all questions in this section)
36. From your Greenfoot lessons, which of the following are exampl
(Choose all correct answers)
Playing a range of sounds when k
A single instance displays a single
Assigning a different keyboard ke
Programming a single movement
Assigning a different image file to
Incorrect. Refer to Section 3 L
37. From your Greenfoot lessons, which of the following is an examp
Methods
Classes
Integers (*)
Scenarios
Correct
38. From your Greenfoot lessons, which of the following are properti
Size
Color
Image file
Methods
All of the above (*)
Correct
39. In the Greenfoot IDE, which of the following is not a property of
Position
Inherited methods
Scenario name (*)
Defined methods
Correct
40. In the following Greenfoot method signature, which is the metho
void turnLeft()
()
void
turnLeft (*)
Left
Incorrect. Refer to Section 3 L
Page 8 of 10
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 3
(Answer all questions in this section)
41. From your Greenfoot lessons, if the condition in an if-statement i
True (*)
False
Correct
42. From your Greenfoot lessons, which of the following methods re
World getClass()
World getWorld()
int getRotation() (*)
getXY()
Correct
43. From your Greenfoot lessons, how do you call a defined method?
Call the method from the act meth
Call the method from the defined
Write the method in the World sup
Write the method in the instance.
Write the method in the source co
Correct
44. From your Greenfoot lessons, to save space in the act method, yo
Class method
Instance method
Defined method (*)
World method
Code method
Correct
45. In Greenfoot, a constructor has a void return type. True or false?
True
False (*)
Incorrect. Refer to Section 3 L
Page 9 of 10
Test: Java Fundamentals Midterm Exam
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 3
(Answer all questions in this section)
46. In Greenfoot, which method is used to add a new instance to a scenario when
addClass
addWorld
addObject (*)
addInstance
Incorrect. Refer to Section 3 Lesson 8.
47. Greenfoot Actor instances get their images from which of the following?
Their class (*)
Their source code
Their image editor
Their methods
Incorrect. Refer to Section 3 Lesson 8.
48. In Greenfoot, the image below is an example of what construct?
Method
Conditional (*)
Variable Assignment
Class
Correct
49. In Greenfoot, dot notation is used to call a _____________ from another class
Method (*)
Class
Signature
Parameter
Correct
50. Use your Greenfoot skills to answer the question. What is incorrect in this cod
Spacing missing
Curly brace missing
Parenthesis missing (*)
Comma missing
Correct
Page 10 of 10