Professional Documents
Culture Documents
Quizzz PDF
Quizzz PDF
Mark
for Review
Together
Do together (*)
Do in order
While
2. Which Alice execution task corresponds with the following storyboard statemen
t?
Cat rolls to the left.
Mark for Review
roll Left 1
this.Cat roll Left 1.0 (*)
Cat roll Left 1
Cat roll Right 1
Correct
3. In Alice, control statements are dragged into the Code editor. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
4. In Alice, the while control statement executes a set of procedures a specific
number of times.
True or false?
Mark for Review
(1) Points
True
False (*)
Correct
5. In Alice, the computer specifies the low and high range values for the range
of numbers from
which to pull a randomized number. True or false?
Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 2 Lesson 4.
6. In Alice, which of the following arguments could be replaced with a random nu
mber? Mark for Review
(1) Points
(Choose all correct answers)
Distance (*)
Object name
Duration (*)
Direction
Procedure name
1. In Alice, which of the following is not a control statement? Mark for Review
(1) Points
Do In Order
While
Count
Move (*)
Incorrect. Refer to Section 2 Lesson 6.
2. In Alice, which control statement is used to invoke simultaneous movement? Ma
rk for Review
(1) Points
Do Together (*)
Do In Order
While
Count
Variable
Incorrect. Refer to Section 2 Lesson 6.
3. In Alice, a walking motion for a bipedal object can be achieved without the D
o Together control
statement. True or false?
Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 2 Lesson 6.
4. In Alice, different programming is not required for different objects, becaus
e all objects move
the same way. True or false?
Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 2 Lesson 6.
5. In Alice, when two objects are synchronized and move together, this means tha
t one object is: Mark for Review
(1) Points
A vehicle of another (*)
A class of another
An object of another
An instance of another
Incorrect. Refer to Section 2 Lesson 6.
6. In Alice, which procedure is used to assign one object as the vehicle of anot
her? Mark for Review
(1) Points
setClassVehicle
setObjectVehicle
setVehicle (*)
Vehicle
Correc
1. In Alice, where can you view the list of functions available for an object? M
ark for Review
(1) Points
Class description in the Scene editor.
Functions tab in the methods panel. (*)
Instance pull-down menu.
Properties tab in the methods panel.
Correct
2. In Alice, functions ask questions about an object. True or false? Mark for Re
view
(1) Points
True
False (*)
Correct
In Alice, the If control structure can process one true and one false response.
True or false? Mark for Review
(1) Points
True (*)
False
Correct
2. The Alice If control structure requires the false statement to be populated.
True or false? Mark for Review
(1) Points
True
False (*)
Correct
3. A conditional loop is a loop that will continue forever. True or false? Mark
for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 2 Lesson 8.
4. In Alice, we use the While control statement to implement the conditional loo
p. True or false? Mark for Review
(1) Points
True (*)
False
In Greenfoot, what happens to an instance when the Act button is clicked in the
environment? Mark for Review
(1) Points
Only one instance moves until the pause button is clicked.
The instance executes all of the programming statements in their class's act met
hod once.
(*)
The instance executes all of the programming statements in their class's act met
hod
repeatedly until the scenario is stopped.
The instance executes all of the programming statements in their class's act met
hod two
times until the scenario is stopped.
The class executes all of the programming statements in their instance's act met
hod two
times until the scenario is stopped.
Incorrect. Refer to Section 3 Lesson 1.
2. In Greenfoot, the Run button repeatedly executes all of the programming state
ments inthe
class's act method in sequential order until the pause button is clicked. True o
r false?
Mark for Review
(1) Points
True (*)
False
Correct
3. An object is an instance of a class. True or false? Mark for Review
(1) Points
True (*)
False
Correct
4. In Greenfoot, the class holds the general attributes of an instance, such as
the methods it
inherits. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
5. A subclass has what kind of relationship to a superclass? Mark for Review
(1) Points
"for-what"
"a-is"
"is-a" (*)
"is-by"
Incorrect. Refer to Section 3 Lesson 1.
6. What does an instance of the World class do? Mark for Review
(1) Points
Provide the acting objects for the scenario.
Provide the background scenery for the scenario. (*)
Provide the superclass for acting objects.
Provide the source code for instances.
Correct
7. In Greenfoot, after a subclass is created, what has to occur before instances
can be added to
the scenario?
Mark for Review
(1) Points
Creation of an instance
Compilation (*)
Creation of source code
Editing of source code
http://ilearning.oracle.com/ilearn/en/assessment/jsp/test_player.jsp?Init=Y
1 of 2 3/27/2015 5:51 AM
Correct
8. In Greenfoot, after a subclass is created and compiled, you cannot edit the s
ubclass's source
code. True or false?
Mark for Review
(1) Points
True
False (*)
In Greenfoot, the move method expects what type of information in its parameters
? Mark for Review
(1) Points
Degrees to turn
True or false response
String statement
Integer of steps to move forward (*)
Incorrect. Refer to Section 3 Lesson 2.
2. In Greenfoot, the turn method expects what type of information in its paramet
ers? Mark for Review
(1) Points
Degrees to turn (*)
True or false response
String statement
Integer of steps to move forward
Parameter void
Incorrect. Refer to Section 3 Lesson 2.
3. Using the Greenfoot IDE, only five instances can be added to a scenario. True
or false? Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 3 Lesson 2.
4. In Greenfoot, the instance has a source code editor. True or false? Mark for
Review
(1) Points
True
False (*)
Incorrect. Refer to Section 3 Lesson 2.
5. In the Greenfoot IDE, an instance's position is on the x and y coordinates. T
rue or false? Mark for Review
(1) Points
True (*)
False
Correct
6. In Greenfoot, which of the following options are not possible when associatin
g an image file
with an instance?
Mark for Review
(1) Points
Add a video (*)
Draw an image
Import an image
Select an image from the Greenfoot library
Incorrect. Refer to Section 3 Lesson 2.
7. An instance variable can be saved and accessed later, even if the instance no
longer exists. True
or false?
Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 3 Lesson 2.
8. A variable is also known as a ____________. Mark for Review
(1) Points
Instance
http://ilearning.oracle.com/ilearn/en/assessment/jsp/test_player.jsp?Init=Y
1 of 2 3/27/2015 5:53 AM
Class
Field (*)
Syntax
Method
Incorrect. Refer to Section 3 Lesson 2.
9. In Greenfoot, the body of the method is located in between which of the follo
wing characters? Mark for Review
(1) Points
Parnetheses ( )
Curly brackets { } (*)
Square brackets [ ]
Asterisks **
Correct
10. In Greenfoot, methods can be called in the act method. When the Act button i
s clickedin the
environment, the methods in the method body of the act method are executed. True
or false?
Mark for Review
(1) Points
True (*)
False
In Greenfoot, the sound file must be saved in the scenario and written in the so
urce code for it
to play. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
2. You cannot record unique sounds in Greenfoot. You can only use the sounds tha
t are stored in
the Greenfoot library. True or false?
Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 3 Lesson 7.
3. What type of parameter does the keyDown method expect? Mark for Review
(1) Points
The password that will protect the class.
The name of the key to press on the keyboard. (*)
The name of the class that will use the key.
The name of the sound file to play when the key is pressed.
In Greenfoot, which method body correctly adds an instance of the World to a sce
nario, with
size x = 300 y = 300 and a resolution of 2 pixels per cell?
Mark for Review
(1) Points
world(300, 300, 2);
Super(300,300,2);
super(2,300,300);
super(300,300,2); (*)
Incorrect. Refer to Section 3 Lesson 8.
2. A constructor is executed once in the course of a Greenfoot scenario. True or
false? Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 3 Lesson 8.
3. Which of the following Greenfoot programming statements creates a new instanc
e of Duke, and
places him at x = 140, y = 130 in the world?
Mark for Review
(1) Points
addObject(new( ), 140, 130);
addObject(new Duke( ), 140, 130); (*)
new(addObject(Duke ), 140, 130);
new(Duke( ) 140, 130);
Correct
4. Which keyword is used to add an actor to a Greenfoot world? Mark for Review
(1) Points
addObject
add
new (*)
super
Incorrect. Refer to Section 3 Lesson 8.
5. Which of the following is the correct syntax for declaring a variable in Gree
nfoot? Mark for Review
(1) Points
(Choose all correct answers)
public variable-type variable-name; (*)
private variable-name, variable-type;
public variable-name variable type;
private variable-type variable-name; (*)
Incorrect. Refer to Section 3 Lesson 8.
6. In Greenfoot, what is the purpose of the variable type? Mark for Review
(1) Points
Defines the access specifier used with the variable.
Defines what kind of data to store in the variable. (*)
Defines which class the variable is associated with.
Defines the instance that the variable is associated with.
Correct
7. Which operator is used to test if values are equal? Mark for Review
(1) Points
<
== (*)
>
http://ilearning.oracle.com/ilearn/en/assessment/jsp/test_player.jsp?Init=Y
1 of 2 3/27/2015 6:04 AM
!>
Incorrect. Refer to Section 3 Lesson 8.
8. In Greenfoot, the == operator is used to test if two values are equal. True o
r false? Mark for Review
(1) Points
True (*)
False
Correct
9. The GreenfootImage class enables Greenfoot actors to maintain their visible i
mage by holding
an object of type GreenfootImage. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
10. What does the following programming statement mean?
image1 = new GreenfootImage("duke12.png?);
Mark for Review
(1) Points
The variable, image1, cannot use the image file, duke12.png.
The image file, duke12.png, has just been drawn and imported into the scenario.
The image file, duke12.png, is assigned to the variable image1. (*)
Image files from 1-119 are associated with image1.
Incorrect. Refer to Section 3 Lesson 8.
11. In Greenfoot, which method is used to end a game? Mark for Review
(1) Points
Class.stop( );
Greenfoot.stop( ); (*)
Duke.stop( );
Game.stop(1);
Correct
12. Where can we review the available classes and methods in Greenfoot, includin
g the stop
method?
Mark for Review
(1) Points
Class menu
Object menu
Class Application Programmers' Interface (API)
Greenfoot Application Programmers' Interface (API) (*
From your Greenfoot lessons, which of the following are examples of when abstrac
tion
techniques are used?
Mark for Review
(1) Points
Assigning a sound file to an instance.
Assigning a keyboard key to an instance.
Assigning an image file to an instance.
All of the above. (*)
Incorrect. Refer to Section 3 Lesson 9.
2. Abstraction occurs in many different ways in programming. True or false? Mark
for Review
(1) Points
True (*)
False
From your Greenfoot lessons, which of the following are examples of actions that
can be
achieved using the while loop?
Mark for Review
(1) Points
Create 50 instances of the Duke class.
Call the move method 1 million times.
Call the move and turn methods 10 times.
Create 100 instances of an Actor subclass.
All of the above. (*)
Incorrect. Refer to Section 3 Lesson 10.
2. Which of the following is not a component of a while loop? Mark for Review
(1) Points
Local variable
Control operator
Loop variable
if statement (*)
while keyword
Incorrect. Refer to Section 3 Lesson 10.
3. If an end to a while loop is not established, what happens? Mark for Review
(1) Points
The code stops after 10 executions.
The code stops after 20 executions.
The condition becomes false after one minute of executions.
The code executes and does not stop. (*)
Incorrect. Refer to Section 3 Lesson 10.
4. Infinite loops are a common cause of errors in programming. True or false? Ma
rk for Review
(1) Points
True (*)
False
Correct
5. An array is an object that holds multiple methods. True or false? Mark for Re
view
(1) Points
True
False (*)
Incorrect. Refer to Section 3 Lesson 10.
6. In Greenfoot, arrays are a way to hold and access multiple variables, and ass
ign different values
to new instances each time the while loop executes and produces a new instance.
True or false?
Mark for Review
(1) Points
True (*)
False
Correct
7. Which of the following Greenfoot logic operators represents "not"? Mark for
Review
(1) Points
&
&&
=
! (*)
Correct
http://ilearning.oracle.com/ilearn/en/assessment/jsp/test_player.jsp?Init=Y
1 of 2 3/27/2015 6:07 AM
8. In the Greenfoot IDE, what does the AND operator (&&) do? Mark for Review
(1) Points
Compares two boolean values, and returns a boolean value which is true if and on
ly ifboth
of its operands are true. (*)
Compares two boolean values, and returns a boolean value which is true if and on
ly ifone
of its operands are true.
Compares two boolean values and returns a boolean value which is true if either
one of the
operands is true.
Compares two boolean variables or expressions and returns a result that is true
if either of
its operands are true.
Correct
9. In Greenfoot, a local variable is declared at the beginning of a class. True
or false? Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 3 Lesson 10.
10. In Greenfoot, what types of values cannot be stored in a local variable? Mar
k for Review
(1) Points
Class name
Objects
Integers
World name
Method (*)
Incorrect. Refer to Section 3 Lesson 10.
11. In Greenfoot, string concatenation reduces the number of redundant character
s or phrases you
need to type into each array. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
12. Which of the following is an example of string concatenation? Mark for Revi
ew
(1) Points
Instead of entering ".png" after each image file name, add && ".png" after the i
mageName
value in the programming statement.
Instead of entering ".png" after each image file name, add = ".png" after the im
ageName
value in the programming statement.
Instead of entering ".png" after each image file name, add + ".png" after the im
ageName
value in the programming statement. (*)
Instead of entering ".png" after each image file name, add ".png" after the imag
eName
value in the programming statement.
From your Greenfoot lessons, the __________ control structure is used to compare
and make a decision. Mark for Review
(1) Points
Conditional (*)
Repetition
Obsolete
Rewind
Incorrect. Refer to Section 3 Lesson 12.
2. From your Greenfoot lessons, the __________ control structure is often referr
ed to asloops. Mark for Review
(1) Points
Conditional
Repetition (*)
Obsolete
Rewind
Incorrect. Refer to Section 3 Lesson 12.
3. The construct listed below is described as a __________________.
/**
* Get value and store in variable
*/
Mark for Review
(1) Points
Method
Comment (*)
Variable Assignment
Instruction
Correct
4. The construct listed below is described as a __________________.
termvar = scanterm.nextLine();
Mark for Review
(1) Points
Method
Comment
Variable Assignment (*)
Instruction
Correct
5. What is wrong with the following line of code?
System.out.println(termvar + '; '+ termdef );
Mark for Review
(1) Points
There are parenthesis instead of brackets.
There are parenthesis instead of curly braces.
There are single quotes instead of double quotes. (*)
The command is incorrectly capitalized.
Nothing is wrong with the code.
Incorrect. Refer to Section 3 Lesson 12.
6. Which line of code contains a syntax error? Mark for Review
(1) Points
2
3 (*)
4
5
6
Incorrect. Refer to Section 3 Lesson 12.
7. In which step to create a Greenfoot game do you find and resolve errors in th
e game? Mark for Review
(1) Points
Define the problem
Design the solution
Program the solution
Test the solution (*)
Incorrect. Refer to Section 3 Lesson 12.
8. In which step to create a Greenfoot game is the solution implemented? Mark fo
r Review
(1) Points
Define the problem
Design the solution
Program the solution (*)
Test the solution
Incorrect. Refer to Section 3 Lesson 12.
9. From your Greenfoot lessons, which of the following are examples of Q/A test
variations? Mark for Review
(1) Points
Change the environment, change the programmer, change the execution
Change the execution, change the data, change the environment (*)
Change the environment, change the execution, change the language
All of the above.
Correct
10.The variations listed below are examples of changing what part of Q/A testing
?
Input numbers when characters are expected
Input characters when numbers are expected
Input symbols
Mark for Review
(1) Points
Change the environment
Change the execution
Change the data (*)
None of the above
In Alice, which of the following is the most likely situation where procedural a
bstraction could
be used?
Mark for Review
(1) Points
Five dogs all need to bark and run at the same time. (*)
One fish needs to swim forward 1 meter.
Two fish say something to each other.
One person moves up 10 meters.
Incorrect. Refer to Section 2 Lesson 5.
2. From your Alice lessons, where on an object do an object's axes intersect? Ma
rk for Review
(1) Points
At the object's chest
At the object's head
At the object's center point (*)
At the object's bottom
Correct
3. From your Alice lessons, which control statement executes instructions simult
aneously? Mark for Review
(1) Points
Do in order
Count
Variable
Do together (*)
Incorrect. Refer to Section 2 Lesson 4.
4. In Alice, which of the following programming statements moves the cat backwar
d, half the
distance to the bird?
Mark for Review
(1) Points
this.Cat move backward {this.Bird getDistanceTo this.Cat / 2}
this.Cat move forward {this.Bird getDistanceTo this.Cat / 2}
this.Bird move forward {this.Bird getDistanceTo this.Cat / 2}
this.Cat move backward {this.Cat getDistanceTo this.Bird / 2} (*)
Correct
5. 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 (*)
Incorrect. Refer to Section 2 Lesson 6.
Define the value of the variable LapCount based on the following math calculatio
n: LapCount + 10
= 15
Mark for Review
(1) Points
2
4
5 (*)
15
10
Correct
7. The Alice IF control structure requires the false statement to be populated.
True or false? Mark for Review
(1) Points
True
False (*)
Correct
8. The say procedure in Alice plays an audio file. True or false? Mark for Revie
w
(1) Points
True
False (*)
Incorrect. Refer to Section 2 Lesson 3.
9. What do lines 7, 10 and 13 do in the following code? Mark for Review
(1) Points
Export files called A, B, and num3.
Create a single file containing A, B, and the value of num3.
Print "A", "B" and the value of num3 on the screen. (*)
None of the above.
Incorrect. Refer to Section 2 Lesson 14.
10.Which of the following are examples of elements you would test in your Alice
animation? Mark for Review
(1) Points
(Choose all correct answers)
All of the procedures display in alphabetical order in the Procedures tab.
Math expressions calculate as expected. (*)
Objects move with smooth timing. (*)
Use your Greenfoot knowldege: Abstraction occurs in many different ways in progr
amming. True or false? Mark for Review
(1) Points
True (*)
False
Correct
27.From your Greenfoot lessons, where do you review a class's inherited methods?
Mark for Review
(1) Points
Act method
Documentation (*)
Inspector
If-statement
Incorrect. Refer to Section 3 Lesson 3.
Section 4
(Answer all questions in this section)
28.Which of the following defines a driver class? Mark for Review
(1) Points
Contains a main method and other static methods. (*)
Contains classes that define objects.
Contains a main method, a package, static methods, and classes that define objec
ts.
None of the above.
Incorrect. Refer to Section 4 Lesson 2.
29.Examine the following code:
What is the value of variable x?
Mark for Review
(1) Points
2 (*)
2.5
6
14
Correct
30.When converting gallons to liters its best to put the calculation result into
a variable with a _______________
data type.
Mark for Review
(1) Points
int
double (*)
boolean
None of the above
Incorrect. Refer to Section 4 Lesson 1
Four variables are required to support a conversion of one unit of measure to an
other unit of
measure. True or False?
Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 4 Lesson 1.
32. Given the code
String s1 = "abcdef";
String s2 = "abcdef";
String s3 = new String(s1);
Which of the following would equate to false?
Mark for Review
(1) Points
s1 == s2
s1 = s2
s3 == s1 (*)
s1.equals(s2)
s3.equals(s1)
Incorrect. Refer to Section 4 Lesson 4.
33. The following code is an example of creating a String reference:
String s;
True or false?
Mark for Review
(1) Points
True (*)
False
Incorrect. Refer to Section 4 Lesson 4.
Section 5
(Answer all questions in this section)
34. Which of the following correctly matches the switch statement keyword to its
function? Mark for Review
(1) Points
(Choose all correct answers)
switch: tells the compiler the value to compare the input against
default: signals what code to execute if the input does not match any of the cas
es (*)
case: signals what code is executed if the user input matches the specified elem
ent (*)
if: records the user's input and sends it to the case statements to find a possi
ble match
switch: identifies what element will be compared to the element of the case stat
ements to
find a possible match (*)
Incorrect. Refer to Section 5 Lesson 1.
35. Why are loops useful? Mark for Review
(1) Points
They save programmers from having to rewrite code.
They allow for repeating code a variable number of times.
They allow for repeating code until a certain argument is met.
All of the above. (*)
What is the output of the following segment of code?
int array[][] = {{1,2,3},{3,2,1}};
for(int i=0;i<2;i++)
for(int j=0;j<3;j++)
System.out.print(2*array[1][1]);
Mark for Review
(1) Points
444444 (*)
123321
246642
222222
This code doesn't compile.
Incorrect. Refer to Section 6 Lesson 1.
37. Which of the following declares and initializes a one dimensional array that
can hold 5 Object
reference types?
Mark for Review
(1) Points
String[] array=new String[5];
Object array=new Object[5]; (*)
Object[] array=new Object[4];
String[] array=String[4];
Incorrect. Refer to Section 6 Lesson 1.
38. Selection sort is a sorting algorithm that involves finding the minimum valu
e in the list,
swapping it with the value in the first position, and repeating these steps for
the remainder of
the list. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
39. Bubble Sort is a sorting algorithm that involves swapping the smallest value
into the first index,
finding the next smallest value and swapping it into the next index and so on un
til the array is
sorted. True or false?
Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 6 Lesson 2.
40. What are exceptions used for in Java? Mark for Review
(1) Points
Correcting mistakes made in your code and handling extraordinary cases. (*)
Exceptions have no use, they are just a part of the Java language.
Helping the interpreter compile code quicker and handle user interfaces.
Making the program easier to use for the user and reducing the possibilities of
errors
occuring
What operator do you use to call an object's constructor method and create a new
object? Mark for Review
(1) Points
+
new (*)
instanceOf
Correct
42. Which of the following creates a class named Student with one constructor, a
nd 2 instance
variables, name and gpa?
Mark for Review
(1) Points
public class Student { private String name; private float gpa; }
public class Student private String name; private float gpa; Student();
public class Student { private String name; private float gpa; Student(){ name="
Jane Doe";
gpa=3.0;} } (*)
public class Student { private String name; Student{ name="Jane Doe"; float gpa=
3.0; }
Incorrect. Refer to Section 7 Lesson 1.
43. What is the output of the following code segment:
int n = 13;
System.out.print(doNothing(n));
System.out.print(" ", n);
where the code from the method doNothing is:
public double doNothing(int n)
{
n = n + 8;
return (double) 12/n;
}
Mark for Review
(1) Points
1.75, 13
0.571, 21
1.75, 21
0.571, 13 (*)
Incorrect. Refer to Section 7 Lesson 1.
44. Static classes are designed as thread safe class instances. True or false? M
ark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 7 Lesson 3.
45. Where should the constructor for a superclass be called? Mark for Review
(1) Points
Anywhere inside the subclass.
Inside the main method of the subclass.
The last line in the constructor of the subclass.
The first line of the constructor in the subclass. (*)
The super constructor does not need to be called inside the subclass.
Why are hierarchies useful for inheritance? Mark for Review
(1) Points
They keep track of where you are in your program.
They restrict a superclass to only have one subclass.
They organize constructors and methods in a simplified fashion.
They are used to organize the relationship between a superclass and its subclass
es. (*)
Correct
47. Which of the following would be most beneficial for this scenario?
Joe is a college student who has a tendency to lose his books. Replacing them is
getting costly.
In an attempt to get organized, Joe wants to create a program that will store hi
s textbooks in
one group of books, but he wants to make each book type the subject of the book
(i.e.
MathBook is a book). How could he store these different subject books into a sin
gle array?
Mark for Review
(1) Points
By ignoring the subject type and initializing all the book as objects of type Bo
ok.
By overriding the methods of Book.
Using polymorphism. (*)
This is not possible. Joe must find another way to collect the books.
Correct
48. Identify the correct way to declare an abstract class. Mark for Review
(1) Points
abstract public class ClassName{...}
public abstract ClassName(...)
public class abstract ClassName(...)
public abstract class ClassName{...} (*)
Incorrect. Refer to Section 7 Lesson 5.
49. It is possible to return an object from a method. True or false? Mark for Re
view
(1) Points
True (*)
False
Incorrect. Refer to Section 7 Lesson 2.
50. Which of the following is the correct way to code a method with a return typ
e an object
Automobile?
Mark for Review
(1) Points
Automobile upgrade(String carA){
carA="Turbo";
return carA;}
Automobile upgrade(Automobile carA){
carA.setTurbo("yes");
return carA;} (*)
String upgrade(String carA){
carA="Turbo";
return carA;}
upgrade(Automobile carA) Automobile{
carA.setTurbo("yes");
return carA;}
None of the above. It is not possible to return an object.
Which of the following can be used as a parameter? Mark for Review
(1) Points
(Choose all correct answers)
Integers (*)
Strings (*)
Constructors
Arrays (*)
Objects (*)
[Correct] Correct
True
False (*)
[Correct] Correct
True
False (*)
True
False (*)
[Correct] Correct
50. Static methods can return any object type. True or false
? Mark for Review
(1) Points
True (*)
False
If an abstract class does not have implemented constructors or methods,
it should be implemented as an interface instead. True or false? Mark for
Review
(1) Points
True (*)
False
A way of redefining methods with the same return type and parameters.
A way to create multiple methods with the same name but different parame
ters.
The concept that a variable or reference can hold multiple types of obje
cts. (*)
Robot.needOil(SqueakyRobot);
SqueakyRobot.needOil();
super.needOil(); (*)
needOil(Robot);
[Correct] Correct
True
False (*)
True (*)
False
Which of the following statements add all of the elements of the one dimensional
array prices, and then prints the sum to the screen? Mark for Review
(1) Points
int total = 0;
for(int i = 0; i total+=prices[i];
int total = 0;
for(int i = 0; i total+=prices[i];
System.out.println(total); (*)
int total = 0;
for(int i = 1; i total = total+prices[i];
System.out.println(prices);
int total = 0;
for(int i = 0; i total+=prices[i];
System.out.println(prices);
37. What will be the content of the array variable table aft
er executing the following code?
1 1 1
0 1 1
0 0 1
1 0 0
0 1 0
0 0 1
1 0 0
1 1 0
1 1 1 (*)
0 0 1
0 1 0
1 0 0
n
n^2
lg(n) (*)
n*lg(n)
[Correct] Correct
It utilizes the "divide and conquer" method, which makes the algorithm m
ore error prone.
It requires incrementing through the entire array in the worst case, whi
ch is inefficient on large data sets. (*)
It involves looping through the array multiple times before finding the
value, which is inefficient on large data sets.
It is never inefficient.
[Correct] Correct
Which of the following defines an object class? Mark for Review
(1) Points
Contains a main method and other static methods.
Contains a main method, a package, static methods, and classes that defi
ne objects.
int
double (*)
boolean
[Correct] Correct
Project
Workspace
Package (*)
Collection
[Correct] Correct
Section 5
(Answer all questions in this section)
34. In an if-else construct the condition to be evaluated mu
st end with a semi-colon. True or false? Mark for Review
(1) Points
True
False (*)
-2 (*)
Method
Conditional (*)
Variable Assignment
Class
[Correct] Correct
At the top of the source code, before the constructors and methods. (*)
[Correct] Correct
Section 4
(Answer all questions in this section)
28. What will the following code segment output? String s="\
\\\\\\\"; System.out.println(s); Mark for Review
(1) Points
"\\\\\"
\\\\\\\\
\\
\\\\ (*)
[Correct] Correct
True
False (*)
I only.
I and II only.
True (*)
False
[Correct] Correct
True
False (*)
[Correct] Correct
True (*)
False
[Correct] Correct
The world
The gallery
[Correct] Correct
keyPress method
keyUp method
keyClick method
In Greenfoot, only 10 methods can be written for each class in the Code
editor. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
Testing
Target (*)
Primary
Programmer
[Correct] Correct
Is a method
True
False (*)
11. A conditional loop is a loop that will continue forever. True or false?
Mark for Review
(1) Points
True
False (*)
[Correct] Correct
True (*)
False
&
&& (*)
[Correct] Correct
I (*)
[Correct] Correct
An Alice event is considered what? Mark for Review
(1) Points
An object's orientation.
Error handling.
[Correct] Correct
do loop
while loop
if (*)
[Correct] Correct
True (*)
False
[Correct] Correct
10. The comments you enter in Alice should describe the sequ
ence of actions that take place in the code segment. True or false? Mark for
Review
(1) Points
True (*)
False
Examine the following code. What are the variables?
args
n (*)
i (*)
t
In Alice, functions are dragged into the control statement, not the proc
edure. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
[Correct] Correct
To add text to your program that tells the viewer what the code does.