kunci java
DESCRIPTION
kunci jawabanTRANSCRIPT
Test: Java Fundamentals Midterm ExamReview 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 table to align the storyboard steps to the programming instructions. True or false?
Mark for Review (1) Points
True
False (*)
Incorrect. Refer to Section 2 Lesson 4.
2.
In Alice, the procedures' arguments allow the programmer to adjust the object, motion, distance amount, and time duration. True or false?
Mark for Review (1) Points
True (*)
False
Correct
3.
In Alice, Do In Order and Do Together:Mark for Review
(1) Points
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 procedure. True or false?
Mark for Review (1) Points
True
False (*)
Correct
5Which of the following statements about methods is false?Mark for Review
. (1) Points
Classes must be defined directly within a method definition. (*)Methods whose return type is not void are required to include a return statement specifying what to return.The order in which methods are listed within the class is not important.Java does not permit nesting one method definition within another method's definition.
Incorrect. Refer to Section 2 Lesson 14.
Page 1 of 10
Test: Java Fundamentals Midterm ExamReview 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 conditions are met, what type of Java construct would you use?
Mark for Review (1) Points
while loop
if (*)
array
boolean
Correct
7. From your Alice lessons, if you examined a science process that had many steps, which of the following is a way that you could apply functional decomposition to this process?
Mark for Review (1) Points
1. Present the problem as an animation. 2. Further refine and define the tasks needed for each high level step. 3. Identify the high level steps for the science concept.1. Identify the detailed steps for the science concept. 2. Present the problem as an animation.1. Present the problem as an animation.
1. Identify the high level steps for the science concept.2. Further refine and define the tasks needed for each high level step.
3. Present the problem as an animation. (*)
Correct
8. From your Alice lessons, functional decomposition is the process of taking a complex problem or process and growing it into larger parts that are easier to manage. True or false?
Mark for Review (1) Points
True
False (*)
Correct
9. From your Alice lessons, inheritance means that the superclass inherits its traits from the subclass. True or false?
Mark for Review (1) Points
True
False (*)
Incorrect. Refer to Section 2 Lesson 5.
10. In Alice, objects inherit the characteristics of their:Mark for Review
(1) Points
Code
Project
Class (*)
Program
Correct
Page 2 of 10
Test: Java Fundamentals Midterm ExamReview 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 easier to understand and reuse. True or false?
Mark for Review (1) Points
True (*)
False
Correct
12. An Alice event is considered what?Mark for Review
(1) Points
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 procedure. True or false?
Mark for Review (1) Points
True
False (*)
Correct
14. Which of the following is not a relational operator?Mark for Review
(1) Points
<
// (*)
>
=
Correct
15. Which of the following is not a valid arithmetic operator in Java?
Mark for Review (1) Points
+
/
-
*
%
None of the above (*)
3x3=9 (*)
None of the above
Incorrect. Refer to Section 2 Lesson 9.
20. In Alice, we can avoid object collision using what?Mark for Review
(1) Points
Slowing movements down.
Using math operators. (*)
Downloading the Alice 3 collision detector app.
Using object detection.
Correct
Page 4 of 10
Test: Java Fundamentals Midterm ExamReview 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; once there, the information can be retrieved and changed. True or false?
Mark for Review (1) Points
True (*)
False
Correct
22. From your Alice lessons, variables are fixed and cannot be changed. True or false?
Mark for Review (1) Points
True
False (*)
Correct
Section 3
(Answer all questions in this section)
23. What type of parameter does the Greenfoot playSound method expect?
Mark for Review (1) Points
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 concatenation is a way to avoid having to write additional characters in your source code. True or false?
Mark for Review (1) Points
True (*)
False
Correct
25. From your Greenfoot lessons, which symbol represents string concatenation?
Mark for Review (1) Points
Symbol &
Symbol <
Symbol =
Symbol + (*)
Correct
Page 5 of 10
Test: Java Fundamentals Midterm ExamReview 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 operators represents "and"?
Mark for Review (1) Points
&
&& (*)
=
!
Correct
27. From your Greenfoot lessons, what types of values cannot be stored in a local variable?
Mark for Review (1) Points
(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 to creating a new subclass?
Mark for Review (1) Points
Right-click on a superclass.
Click New subclass...
Name the class.
Select an image for the class.
Program the class to move forward. (*)
Correct
29. In Greenfoot, you must first create an instance before you create a class. True or false?
Mark for Review (1) Points
True
False (*)
Incorrect. Refer to Section 3 Lesson 1.
30. From your Greenfoot lessons, how do you test that your code does not contain bugs?
Mark for Review (1) Points
Write the code.
Inspect the instances.
Review the documentation.
Compile the code. (*)
Correct
Page 6 of 10
Test: Java Fundamentals Midterm ExamReview 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 purpose for your game. True or false?
Mark for Review (1) Points
True (*)
False
Correct
32. From your Greenfoot lessons, what can methods belong to?Mark for Review
(1) Points
(Choose all correct answers)
Galleries
Classes (*)
Scenarios
Objects (*)
All of the above
Correct
33. From your Greenfoot lessons, which programming statement creates a new Duke object, and places it at x = 120, y = 100 in the world?
Mark for Review (1) Points
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 method from a different class, if the class you are programming does not possess the method. True or false?
Mark for Review (1) Points
True (*)
False
Correct
35. Use you Greenfoot knowledge: What range of numbers does the following method return?
Greenfoot.getRandomNumber(30)
Mark for Review (1) Points
A random number between 1 and 30.
A random number between 0 and 30.
A random number between 0 and 29. (*)
A random number between 1 and 29.
Correct
Page 7 of 10
Test: Java Fundamentals Midterm ExamReview 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 examples of abstraction?
Mark for Review (1) Points
(Choose all correct answers)
Playing a range of sounds when keyboard keys are pressed. (*)A single instance displays a single image.
Assigning a different keyboard key to each instance. (*)
Programming a single movement for a single instance.
Assigning a different image file to each instance. (*)
Incorrect. Refer to Section 3 Lesson 9.
37. From your Greenfoot lessons, which of the following is an example of a type of data passed through a parameter?
Mark for Review (1) Points
Methods
Classes
Integers (*)
Scenarios
Correct
38. 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 (*)
Correct
39. In the Greenfoot IDE, which of the following is not a property of an instance?
Mark for Review (1) Points
Position
Inherited methods
Scenario name (*)
Defined methods
Correct
40. In the following Greenfoot method signature, which is the method name?
void turnLeft()
Mark for Review (1) Points
()
void
turnLeft (*)
Left
Incorrect. Refer to Section 3 Lesson 2.
Page 8 of 10
Test: Java Fundamentals Midterm ExamReview 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 is true, the first code segment is executed. True or false?
Mark for Review (1) Points
True (*)
False
Correct
42. From your Greenfoot lessons, which of the following methods return the current rotation of the object?
Mark for Review (1) Points
World getClass()
World getWorld()
int getRotation() (*)
getXY()
Correct
43. From your Greenfoot lessons, how do you call a defined method?
Mark for Review (1) Points
Call the method from the act method. (*)
Call the method from the defined method.
Write the method in the World superclass.
Write the method in the instance.
Write the method in the source code.
Correct
44. From your Greenfoot lessons, to save space in the act method, you can write an entirely new method below it, called a _____________.
Mark for Review (1) Points
Class method
Instance method
Defined method (*)
World method
Code method
Correct
45. In Greenfoot, a constructor has a void return type. True or false?
Mark for Review (1) Points
True
False (*)
Incorrect. Refer to Section 3 Lesson 8.
Page 9 of 10
Test: Java Fundamentals Midterm ExamReview 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 the world is initialized?
Mark for Review
(1) Points
addClass
addWorld
addObject (*)
addInstance
Incorrect. Refer to Section 3 Lesson 8.
47.
Greenfoot Actor instances get their images from which of the following?
Mark for Review
(1) Points
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?Mark for Review
(1) Points
Method
Conditional (*)
Variable Assignment
Class
Correct
49.
In Greenfoot, dot notation is used to call a _____________ from another class.
Mark for Review
(1) Points
Method (*)
Class
Signature
Parameter
Correct
50.
Use your Greenfoot skills to answer the question. What is incorrect in this code?
Mark for Review
(1) Points