Академический Документы
Профессиональный Документы
Культура Документы
_______.
Mark for Review
Points
Number type
Programming type
Variable type (*)
Value type
Hello World
True or False (*)
An object
3.
The initializer of a variable with a TextString value t
ype could be (select all that apply):
Mark for Review
(1) Points
(Choose all correct answers)
"Greetings" (*)
"Howdy" (*)
"4" (*)
None of the above.
1
25
5 (*)
Correct
5.
(1) Points
A party with at least 20 people.
An object's orientation.
Error handling
A keystroke or mouse click. (*)
Correct
6.
In Alice, when coding for keyboard control, the program
mer's job is to consider at least 70% of every key stroke the user could take. T
rue or false?
Mark for Review
(1) Points
True
False (*)
Correct
8.
The animation checklist helps you confirm that all elem
ents of the animation are operating as expected. True or false? Mark for Review
(1) Points
True (*)
False
Correct
9.
Which of the following elements of the animation should
be tested before the animation is considered complete? Mark for Review
(1) Points
Math calculations operate as expected.
Objects move with smooth timing.
Comments are added to each sequence of instructions.
Control statements are operating as expected.
All of the above. (*)
Correct
10.
The animation should be tested throughout development,
not just at the end of the animation's development. True or false?
Mark fo
r Review
(1) Points
True (*)
False
Correct
Page 1 of 1
Summary
Section 1
(Answer all questions in this section)
ept which one?
(1) Points
1.
The list below describes variables. All are correct exc
Mark for Review
A place in memory where data of a specific type can be stored for later
retrieval and use.
Has a unique name.
Has a type associated with it.
Arranged in rows and columns. (*)
Correct
2.
Mark for Review
(1) Points
args
n
i
t
All of the above are variables. (*)
Correct
3.
The following are examples of what in Java?
boolean
byte
char
short
int
long
float
double Mark for Review
(1) Points
Types (*)
Expressions
Variables
Specifications
Correct
4.
except which one?
(1) Points
boolean
String (*)
long
int
double
+
/
*
%
$ (*)
Correct
6.
Results of arithmetic operations cannot be stored in a
variable. True or false?
Mark for Review
(1) Points
True
False (*)
Correct
7.
Expressions with relational operators produce true and
false values. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
8.
Correct
9.
If a value has been assigned to (is stored in) a variab
le, that value will be overwritten when another value is assigned to the variabl
e using the assignment "=" operator. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
10.
Mark for Review
(1) Points
j is 5
k is 5 (*)
j is 10
j is 5
k is 5
j is 10
k is 10
j is 15
k is 15
Correct
Test: Correlating Java Methods, Classes, and Other Structures with Alice 3 Tools
: Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indica
tes a correct answer.
Section 1
(Answer all questions in this section)
1.
The list below contains method descriptions. All are cor
rect except which one? Mark for Review
(1) Points
(Choose all correct answers)
A subprogram that acts on data and often returns a value. (*)
A set of code that is referred to by name. (*)
Can be called at any point in a program simply by utilizing its name.
Is associated with an instance variable.
Correct
2.
A method (*)
A class
A variable
Correct
4.
You want a block of code to be executed only once if ce
rtain conditions are met. What type of Java construct would you use?
Mark fo
r Review
(1) Points
while loop
if (*)
array
boolean
Correct
5.
If you want one message to display if a user is below t
he age of 18 and a different message to display if the user is 18 or older, what
type of construct would you use?
Mark for Review
(1) Points
for all loop
do loop
while loop
if (*)
Correct
6.
If you need to repeat a group of Java statements many t
imes, which Java construct should you use?
Mark for Review
(1) Points
(Choose all correct answers)
repeat...until
do while loop (*)
while loop (*)
if
Correct
7.
Select the result from the following statements about what happens when the loop
Val >= 5 .
Mark for Review
(1) Points
The message "Printing Some Text" will be printed until loopVal is no lon
ger less than 5.
The variable loopVal is initialized to 0.
Correct
9.
e. True or false?
(1) Points
True
False (*)
Correct
11.
Consider the following: You want to use the BufferedRea
der and InputStreamReader classes to get user input from the command line. Which
one of the following import statements must you use?
Mark for Review
(1) Points
import java.awt.*;
import java.buffer.*;
import java.io.*; (*)
import java.io.input.*;
Correct
Correct
2.
In Greenfoot, the Run button repeatedly executes all of
the programming statements in the class's act method in sequential order until
the pause button is clicked. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
3.
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 superclas
s?
Mark for Review
(1) Points
"for-what"
"a-is"
"is-a" (*)
"is-by"
Correct
6.
r 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.
Mark fo
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
Correct
8.
In Greenfoot, after a subclass is created and compiled,
you cannot edit the subclass's source code. True or false?
Mark for Review
(1) Points
True
Correct
2.
In Greenfoot, the turn method expects what type of info
rmation in its parameters?
Mark for Review
(1) Points
Degrees to turn (*)
True or false response
String statement
Integer of steps to move forward
Parameter void
Correct
3.
Using the Greenfoot IDE, only five instances can be add
ed to a scenario. True or false?
Mark for Review
(1) Points
True
False (*)
Correct
ue or false?
(1) Points
4.
In Greenfoot, the instance has a source code editor. Tr
Mark for Review
True
False (*)
Correct
5.
True (*)
False
Correct
6.
In Greenfoot, which of the following options are not po
ssible when associating 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
Correct
7.
An instance variable can be saved and accessed later, e
ven if the instance no longer exists. True or false?
Mark for Review
(1) Points
True
False (*)
Correct
8.
r Review
(1) Points
Instance
Class
Mark fo
Field (*)
Syntax
Method
Correct
9.
In Greenfoot, the body of the method is located in betw
een which of the following 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 is clicked in the environment, the methods in the method bod
y of the act method are executed. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
Page 1 of 1
Summary
False (*)
Correct
Page 1 of 1
Summary
Correct
2.
(1) Points
Documentation
Comments
Method body
Instance creator (*)
Class description
Correct
3.
In a Greenfoot if-statement, the programming statements
that the if-statement executes are written in curly brackets. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
4.
An if-statement requires which type of information retu
rned from the condition?
Mark for Review
(1) Points
Integer
Action
True or false (*)
Method
Correct
5.
object's orientation?
(1) Points
void move()
int getRotation() (*)
int getX() (*)
void turn()
Correct
6.
In Greenfoot, which of the following methods return the
world that the instance lives in?
Mark for Review
(1) Points
World getClass()
World getWorld() (*)
getRotation()
getXY()
Correct
Page 1 of 1
Summary
move(): (*)
move(2);
turn(25);
turn(2);
Correct
2.
Which of the following features of Greenfoot will teach
you how to identify bugs in your program?
Mark for Review
(1) Points
Code editor
Compilation (*)
Instance creation
Documentation
Correct
3.
In object oriented programming, programmers analyze a p
roblem and create objects to solve the problem. True or false? Mark for Review
(1) Points
True (*)
False
Correct
4.
Mark for Review
(1) Points
Correct
Page 1 of 1
Summary
Section 1
(Answer all questions in this section)
1.
Which of the following Greenfoot methods returns a rand
om number between 0, up to and including 10,000?
Mark for Review
(1) Points
Greenfoot.getRandomNumber(10,000)
Greenfoot.getRandomNumber(10,001) (*)
Greenfoot.getRandomNumber(9,999)
Greenfoot.getRandomNumber(0-10,000)
Correct
2.
What does the following Greenfoot programming statement
tell the class to do?
if (Greenfoot.getRandomNumber(100) < 6) { turn(18); }
Mark for Review
(1) Points
If a random number is returned that is greater than 6, turn 18 degrees.
If a random number is returned that is less than 6, move 18 steps.
If a random number is returned that is less than 6, turn 18 degrees. (*)
Turn 6 degrees, then turn 18 degrees.
Correct
3.
Which of the following comparison operators represents
"greater than or equal"?
Mark for Review
(1) Points
>
>= (*)
= =
! =
Correct
4.
In Greenfoot you can use comparison operators to compar
e a variable to a random number. True or false? Mark for Review
(1) Points
True (*)
False
5.
An if-else statement executes its first code block if a
condition is true, and its second code block if a condition is false, but not b
oth. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
7.
The list below displays characteristics of a Greenfoot
world constructor, except for one. Which one should be removed? Mark for Review
(1) Points
Defines the instance's size and resolution.
Has a void return type. (*)
Has no return type.
Has the same name as the name of the class.
Executed automatically when a new instance of the class is created.
world
constructor
super (*)
addObject
new
Correct
9.
In Greenfoot, which of the following is the correct not
ation for calling a method for an instance of a class? Mark for Review
(1) Points
object-name.method-name(parameters); (*)
class-name.method-name(parameters);
Method-name.object-name(parameters);
Method-name.object-name;
Correct
10.
In Greenfoot, a semicolon is not necessary at the end o
f a method that uses dot notation. True or false?
Mark for Review
(1) Points
True
False (*)
Correct
11.
In Greenfoot, the origin of the world coordinate system
(0,0) starts in the center of the world. True or false?
Mark for Review
(1) Points
True
False (*)
Correct
12.
Which keyword indicates that Greenfoot needs to create
Mark for Review
a new object?
(1) Points
new (*)
addObject
newObject
newClass
Correct
Test: Defining Methods: Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indica
tes a correct answer.
Section 1
(Answer all questions in this section)
1.
In the Greenfoot IDE, any new methods you create are wr
itten in the class's source code, below the act method. True or false? Mark fo
r Review
True (*)
False
Correct
2.
In reference to Greenfoot, if t
he following method was defined in a superclass,
public void lookForEdge(){
...
}
all subclasses of the superclass will inherit the method.
True or false? Mark for Review
True (*)
False
Correct
Correct
2.
You cannot record unique sounds in Greenfoot. You can o
nly use the sounds that are stored in the Greenfoot library. True or false?
Mark for Review
(1) Points
True
False (*)
Correct
3.
Mark for Review
(1) Points
Correct
Page 1 of 1
Summary
(1) Points
world(300, 300, 2);
Super(300,300,2);
super(2,300,300);
super(300,300,2); (*)
Correct
2.
A constructor is executed once in the course of a Green
foot scenario. True or false?
Mark for Review
(1) Points
True
False (*)
Correct
3.
Which of the following Greenfoot programming statements
creates a new instance 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 wo
rld?
Mark for Review
(1) Points
addObject
add
new (*)
super
Correct
5.
Which of the following is the correct syntax for declar
ing a variable in Greenfoot?
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; (*)
Correct
6.
Mark for Review
(1) Points
Correct
7.
Mark for Review
(1) Points
<
== (*)
>
!>
Correct
8.
In Greenfoot, the == operator is used to test if two va
lues are equal. True or false? Mark for Review
(1) Points
True (*)
False
Correct
9.
The GreenfootImage class enables Greenfoot actors to ma
intain their visible image by holding an object of type GreenfootImage. True or
false? Mark for Review
(1) Points
True (*)
False
Correct
10.
The image file, duke12.png, has just been drawn and imported into the sc
enario.
The image file, duke12.png, is assigned to the variable image1. (*)
Image files from 1-119 are associated with image1.
Correct
11.
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 i
n Greenfoot, including the stop method? Mark for Review
(1) Points
Class menu
Object menu
Class Application Programmers' Interface (API)
Greenfoot Application Programmers' Interface (API) (*)
Correct
Page 1 of 1
Summary
Correct
2.
g. True or false?
(1) Points
True (*)
False
Correct
Page 1 of 1
Summary
Correct
2.
Which of the following is not a component of a while lo
op?
Mark for Review
(1) Points
Local variable
Control operator
Loop variable
if statement (*)
while keyword
Correct
3.
If an end to a while loop is not established, what happ
ens?
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. (*)
True (*)
False
Correct
or false?
(1) Points
5.
An array is an object that holds multiple methods. True
Mark for Review
True
False (*)
Correct
6.
In Greenfoot, arrays are a way to hold and access multi
ple variables, and assign 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
ents "not"?
(1) Points
7.
Which of the following Greenfoot logic operators repres
Mark for Review
&
&&
=
! (*)
Correct
8.
In the Greenfoot IDE, what does the AND operator (&&) d
o?
Mark for Review
(1) Points
Compares two boolean values, and returns a boolean value which is true i
f and only if both of its operands are true. (*)
Compares two boolean values, and returns a boolean value which is true i
Correct
9.
In Greenfoot, a local variable is declared at the begin
ning of a class. True or false? Mark for Review
(1) Points
True
False (*)
Correct
10.
a local variable?
(1) Points
Class name
Objects
Integers
World name
Method (*)
Correct
11.
In Greenfoot, string concatenation reduces the number o
f redundant characters or phrases you need to type into each array. True or fals
e?
Mark for Review
(1) Points
True (*)
False
Correct
12.
Which of the following is an example of string concaten
ation? Mark for Review
(1) Points
Instead of entering ".png" after each image file name, add && ".png" aft
er the imageName value in the programming statement.
Instead of entering ".png" after each image file name, add = ".png" afte
r the imageName value in the programming statement.
Instead of entering ".png" after each image file name, add + ".png" afte
r the imageName value in the programming statement. (*)
Instead of entering ".png" after each image file name, add ".png" after
the imageName value in the programming statement.
Correct
Page 1 of 1
Summary
Correct
2.
From your Greenfoot lessons, the __________ control str
ucture is often referred to as loops.
Mark for Review
(1) Points
Conditional
Repetition (*)
Obsolete
Rewind
Correct
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.
Correct
7.
In which step to create a Greenfoot game do you find an
d resolve errors in the game?
Mark for Review
(1) Points
Define the problem
Design the solution
Program the solution
Test the solution (*)
Correct
n implemented?
(1) Points
8.
In which step to create a Greenfoot game is the solutio
Mark for Review
Correct
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 wh
at 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
Correct
Page 1 of 1
\
Summary
Correct
4.
Tabs are used when more than one file is open in the ed
it area. True or False? Mark for Review
(1) Points
True (*)
False
Correct
5.
(1) Points
A combination of views and editors (*)
A combination of views and windows
A combination of editor tabs
None of the above
Correct
6.
The ______________ is the location onto which you will
store and save your files.
Mark for Review
(1) Points
Perspective
Workspace (*)
Editor
None of the above
Correct
7.
A workspace can have one or more stored projects. True
Mark for Review
or false?
(1) Points
True (*)
False
Correct
8.
Correct
9.
In Eclipse, when you run a Java Application, the result
s may be displayed in the Console View. True or False? Mark for Review
(1) Points
True (*)
False
Correct
What is a loop?
(1) Points
A keyword used to skip over the remaining code.
A set of logic that is repeatedly executed until a certain condition is
met. (*)
A segment of code that may only ever be executed once per call of the pr
ogram.
None of the above.
Correct
2.
It is necessary to end all loops at some point in your
Java program. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
4.
Identify which situation could be an example of a WHILE
loop. Mark for Review
(1) Points
Taking coins out of a pile one at a time and adding their value to the t
otal until there are no more coins in the pile to add.
Correct
5.
Which of the following correctly initializes a For loop
that runs through 5 times?
Mark for Review
(1) Points
for(int i = 0; i == 6; i++)
for(int i = 1; i < 6; i++) (*)
for(int i = 0; i < 5; I++)
for(int i = 1; i < 5; I++)
Correct
6.
Mark for Review
(1) Points
default(input)
switch '+':
answer+=num;
break;
case '-':
answer-=num;
break;
!default
System.out.println("Invalid input");
(1) Points
True
False (*)
Correct
8.
and a DO-WHILE loop?
(1) Points
Correct
9.
Which of the following correctly initializes an instanc
e of Scanner, called "in", that reads input from the console screen?
Mark fo
r Review
(1) Points
Scanner in = new Scanner(System.in); (*)
Scanner in = new Scanner("System.in");
Scanner in = Scanner(System.in);
Correct
Test: Using Arrays: Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indica
tes a correct answer.
Section 1
(Answer all questions in this section)
1.
Which of the following statements is a valid array decl
Mark for Review
aration?
(1) Points
Correct
2.
int[] y = new int[5];
(1) Points
True (*)
False
Correct
3.
Which of the following declares a one dimensional array
named "score" of type int that can hold 9 values?
Mark for Review
(1) Points
int score;
int[] score;
int[] score=new int[9]; (*)
int score=new int[9];
Correct
4.
imensional array?
(1) Points
Correct
5.
Which of the following declares and initializes a one di
mensional array named words of size 10 so that all entries can be Strings?
Mark for Review
(1) Points
String words=new String[10];
char words=new char[10];
char[] words=new char[10];
String[] words=new String[10]; (*)
Correct
6.
Mark for Review
(1) Points
222220
0 (*)
220
2
This code does not compile.
Correct
7.
Correct
8.
Which of the following declares and initializes a two d
imensional array named values with 2 rows and 3 columns where each element is a
reference to an Object? Mark for Review
(1) Points
String[][] values={"apples","oranges","pears"};
String[][] values=new String[3][2];
String[][] values=new String[2][3]; (*)
String[][] values;
Correct
9.
Which of the following declares and initializes a two di
mensional array where each element is a reference type? Mark for Review
(1) Points
String words=new String[10];
char[][] words;
char[][] words=new char[10][4];
String[][] words=new String[10][3]; (*)
Correct
11.
Mark for Review
(1) Points
753
6
7766554433221
7531 (*)
This code does not compile.
Correct
12.
The following creates a reference in memory named y that
can refer to five different integers via an index. True or false?
int[] y = new int[5];
(1) Points
True (*)
False
Correct
13.
The following creates a reference in memory named z that
can refer to seven different doubles via an index. True or false?
double z[] = new double[7];
(1) Points
True (*)
False
Correct
14.
What is the output of the following segment of code if t
he command line arguments are "apples oranges pears"?
Mark for Review
(1) Points
apples
pears (*)
oranges
args
This code doesn't compile.
Correct
15.
What is the output of the following segment of code if t
he command line arguments are "apples oranges pears"?
Mark for Review
(1) Points
0
1
2
3 (*)
This code does not compile.
Correct
16.
What will be the content of array variable table after e
xecuting the following code?
Mark for Review
(1) Points
0 0 0
0 0 0
0 0 0
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
Correct
17.
Correct
18.
e following are true?
number[0] is undefined
number[4] is null
number[2] is 0 (*)
number.length() is 6
19.
?
int x[] = int[10];
(1) Points
True
False (*)
Correct
Page 1 of 1
Summary