1.
From your Alice lessons, random numbers are numbers generated by the user with
a pattern in their sequence. True or false? True
False (*)
2.
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?
True False (*)
3.
In Alice, which procedure is used to assign one object as the vehicle of
another? setClassVehicle Vehicle
setObjectVehicle setVehicle (*)
4.
In Alice, Do In Order and Do Together: Are move
statements Are control statements (*) Are
complex statements None of the above
5. In Alice, procedural abstraction is the
concept of making code easier to understand and reuse. True or false?
True (*) False
6. A textual storyboard helps the reader
understand the actions that will take place during the animation. True or
false? True (*) False
7. From your Alice lessons, which of the
following are types of storyboards? Textual (*)
Actual Factual Visual
(*) Fictional
8. Which of the following ways can you modify
the code in the code editor window? Disable (*)
Count Copy & paste (*)
Drag to reorder (*)
9.
To access the Alice Code editor from the Scene editor, which button do you
click? Code Editor Code
Edit Code (*) Access Code Editor
10.
Which of the following procedures turns an object to face another object?
moveToward orientToUpright
turnToFace (*) turn
11.
What do moving objects provide to your scene? The sky and
ground The action (*) The non-moving
scenery The procedures
12.
Rings will appear around a sub-part indicating how you can reposition it. True
or false? True (*) False
13.
In Alice, there is a limit of 10 objects per scene. True or false?
True False (*)
14.
From your Alice lessons, which programming instruction represents the following
movement: A person moves forward the distance to the table, minus the depth of
the person. this.Person move Forward this.Person
getDistanceTo this.Table - this.Table getDepth this.Table
move Forward this.Person getDistanceTo this.Table - this.Table getDepth
this.Person move Forward this.Person getDistanceTo this.Table
- this.Person getDepth (*) this.Person move Forward
this.Person getDistanceTo this.Table + this.Person getDepth
15.
From your Alice lessons, built-in functions provide precise property details
for the following areas: Proximity and point of view.
Proximity, size, spatial relation, and point of view. (*)
Proximity and size. Distance to and
nesting.
1.
From your Alice lessons, variables are fixed and cannot be changed. True or
false? True False (*)
2. Define the value of the variable LapCount
based on the following math calculation: LapCount + 10 = 15
4 5 (*) 15 10
2
3.
Alice uses built-in math operators; they are: Add and
subtract Multiply and divide All of the
above (*) None of the above
4.
Alice uses built-in math operators. They are: Add
Subtract Multiply
Divide All of the above (*)
5.
If you need to repeat a group of Java statements many times, which Java
construct should you use? repeat...until
while loop (*) if do
while loop (*) 6. Which of the following statements about methods is false?
Java does not permit nesting one method definition within
another method's definition. The order in which methods are
listed within the class is not important. 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.
7. The list below describes variables. All are
correct except which one? Arranged in rows and columns. (*)
Has a type associated with it. Has a
unique name. A place in memory where data of a specific type
can be stored for later retrieval and use.
8.
The list below displays valid primitive types in Java, except which one?
int long boolean
String (*) double
9.
In Alice, you must place the control structure in the code editor before adding
any code that will go within it. True or false? True
False (*)
10.
The Alice IF control structure requires the false statement to be populated.
True or false? True False (*)
11.
You want an event to happen when an object collides with another object, which
category of event handler would you choose? Mouse
Position/Orientation (*) Scene
Activation/time Keyboard
12.
When you import a class from another file you have to import the entire class.
True or false? True False (*)
13.
Which of the following elements of the Alice animation should be tested before
the animation is considered complete? 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. (*)
14.
When presenting your Alice animation, ensure that your presentation is
thoroughly tested and complete. True or false? True (*)
False
15.
When presenting your Alice animation, it is not important to give the audience
a reason to listen to the presentation. True or false? True
False (*) 1. From your Greenfoot lessons, a scenario is a
game or simulation implemented in Greenfoot. True or false?
True (*) False
2. An object is an instance of a class. True
or false? True (*) False
3. From your Greenfoot lessons, an instance
inherits all of the characteristics of the class, and those characteristics
cannot be changed. True or false? True
False (*)
4. 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?
True (*) False
5. When designing a game in Greenfoot, it
helps to define the actions that will take place in a textual storyboard. True
or false? True (*) False
6.
In a Greenfoot if-statement, the programming statements that the if-statement
executes are written in curly brackets. True or false? True
(*) False
7.
In Greenfoot, what happens if the condition is false in an if-statement?
The programming statements are executed.
The act method is deleted. The if-statement is executed.
The programming statements are not executed. (*)
8. Using the Greenfoot IDE, only five
instances can be added to a scenario. True or false?
True False (*)
9.
In Greenfoot, the move method expects what type of information in its
parameters? Integer of steps to move forward (*)
True or false response Degrees to turn
String statement
10.
An instance variable can be saved and accessed later, even if the instance no
longer exists. True or false? True
False (*)
11.
In Greenfoot, the body of the method is located in between which of the
following characters? Asterisks ** Curly
brackets { } (*) Square brackets [ ]
Parnetheses ( )
12. The Greenfoot method getRandomNumber is
used to create predictable behaviour in your scenario
True False (*)
13.
In Greenfoot, a semicolon is not necessary at the end of a method that uses dot
notation. True or false? True False
(*)
14.
Which of the following Greenfoot methods returns a random number between 0, up
to and including 10,000? Greenfoot.getRandomNumber(10,001)
(*) Greenfoot.getRandomNumber(9,999)
Greenfoot.getRandomNumber(10,000) Greenfoot.getRandomNumber(0-10,000)
15. From your Greenfoot lessons, what can
methods belong to? Galleries
Classes (*) Scenarios Objects (*)
All of the above
1.
From your Greenfoot lessons, to save space in the act method, you can write an
entirely new method below it, called a _____________.
Instance method World method Class method
Code method Defined method (*)
2.
In Greenfoot a collision is when 2 actors touch? True
(*) False
3.
In Greenfoot, defined methods must be used immediately. True or false?
True False (*)
4. In Greenfoot to get the users name you
could use: Greenfoot.getUserName();
Greenfoot.ask("Input Name: "); (*)
Greenfoot.prompt("Input Name: ");
Actor.prompt("Input Name: ");
5.
From your Greenfoot lessons, the isKeyDown method is located in which class?
Actor GreenfootImage
Greenfoot (*) World
6.
What type of parameter does the keyDown method expect?
The name of the sound file to play when the key is pressed. 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.
7. The GreenfootImage class enables Greenfoot
actors to maintain their visible image by holding an object of type
GreenfootImage. True or false? True (*)
False
8.
Which keyword is used to add an actor to a Greenfoot world?
super addObject (*)
add new
9. In Greenfoot, the == operator is used to
test if two values are equal. True or false? True (*)
False
10.
In Greenfoot, you can cast an Actor class to a World class?
True False (*) 11. In Java what is casting?
Casting is when we change the coordinates of an actor
Casting is when we remove an object from the world
Casting is when we want to tell the java compiler that a
class we are accessing is really another type of class (*)
Casting is when we reset the state of an instance.
12. From your Greenfoot lessons, which one of
the following is an example of when an abstraction technique is used?
Adding a property to an instance Passing
a paramater in a constructor to set an initial speed. (*)
Initialising a variable Adding a property to a Class
13.
In Greenfoot, what is a common letter used for the loop variable?
y a i (*)
x
14.
How would the following sentence be written in Greenfoot source code? If Bee is
turning, and the keyboard key "d" is down... if
(&&isTurning ! Greenfoot.isKeyDown("d") )
if (isTurning && Greenfoot.isKeyDown("d") ) (*)
if (!isTurning && Greenfoot.isKeyDown("d")
) if (!Greenfoot.isKeyDown &&
isTurning("d") )
15.
In Greenfoot, which of the following statements could prevent an infinite loop
from occurring? i = 100 + i i = i + 1 (*)
i=1 i = i 1. Consider the following
method of the class Test:public static List returnList(List list){return
list;}Which of the following program segments in Test's client class will
compile with no errors?I. List nums = new ArrayList();nums = Test.returnList(nums);II.
ArrayList nums = new ArrayList();nums = Test.returnList(nums);III. ArrayList
nums1 = new ArrayList();List nums2 = Test.returnList(nums1);
I only I and III (*)
II only II and III I,
II, and III 2. It is possible to override methods such as equals() and
toString() in a subclass of Object to fit the needs of the objects of the
subclass. True or false? True (*) False
3. 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 his 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 single array? This is not
possible. Joe must find another way to collect the books. By
ignoring the subject type and initializing all the book as objects of type
Book. By overriding the methods of Book.
Using polymorphism. (*) 4. All objects, in Java, are created using int. True or
false? True False (*) 5. The following
code creates an object of type Animal:Animal a; True
False (*) 6. Which constructor code populates the instance
variables of the class correctly? this.certified=certified;
7. Static classes can extend their parent class. True or false?
True (*) False 8. Static classes
are designed as thread safe class instances. True or false?
True False (*) 9. Any instance of
the same class can assign a new value to a static variable. True or false?
True (*) False 10. Which of the
following could be a reason to need to pass an object into a method?
Easier access to the information contained within the
object. The ability to make changes to an object inside of
the method. Comparing two objects. All of
the above. (*) 11. You are assigned to write a method that compares two objects
of type Career. One requirement of your assignment is to have your method
compare the "greatestPossibleSalary" instance data of Career objects.
The "greatestPossibleSalary" field is data type int.What would be the
best return type from your compare method? String,
because is should return a string of the name of the career that is highest
paying because none of the other information of the career matters.
Integer, because it is the easiest to code with.
Array, because it can store the most information.
Career, because if it returns the highest paying Career
object it will be able to use the same method later to compare other aspects of
Career objects. (*) 12. It is possible to overload a method that is not a
constructor. True or False? True (*)
False 13. Methods are generally declared as public so other classes may use
them. True or false? True (*) False 14.
It is possible for a subclass to be a superclass. True or false?
True (*) False 15. An access
modifier is a keyword that allows subclasses to access methods, data, and
constructors from their parent class. True or false? True
(*) False 1. Which of the following defines an Exception?
Code that has no errors and therefore runs smothly.
A very severe non-fixable problem with interpreting and running your code.
A problem that can be corrected or handled by your code. (*)
An interpreter reading your code. 2. What is wrong with this
code? It is missing a semicolon. It
gives you an out of bounds exception. There is nothing wrong
with this code. It does not compile. (*) 3. A logic error
occurs if an unintentional semicolon is placed at the end of a loop initiation
because the interpreter reads this as the only line inside the loop, a line
that does nothing. Everything that follows the semicolon is interpreted as code
outside of the loop. True or false? True
False (*) 4. What does the interpreter look for when an
exception is thrown? The end of the code.
It does not look for anything. It just keeps reading through your code.
It does not look for anything. It stops interpreting your
code. A catch statement in the code. (*) 5. It is possible
to throw and catch a second exception inside a catch block of code. True or
false? True (*) False 6. What will
array arr contain after the following code segment has been executed?int [] arr
= {5, 4, 2, 1, 0};for (int i = 1; i < arr.length; i++){arr[i - 1] +=
arr[i];} 7, 3, 2, 1, 0 10, 6, 3, 1,
0 9, 6, 3, 1, 0 (*) 9, 6, 1, 3, 0
None of the above. 7. Which of the following statements add
all of the elements of the one dimensional array prices, and then prints the
sum to the screen? int total = 0;
for(int i = 0; i total+=prices[i]; 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); int total = 0;
for(int i = 0; i total+=prices[i];
System.out.println(total); (*) 8. What is the output of the following segment
of code? 1111 This code doesn't compile.
321111 11 (*) 111 9.
What will be the content of the array variable table after executing the following
code? 0 0 1 0 1 0
1 0 0 1 0 0 1 1 0
1 1 1 (*) 1 1 1 0 1 1
0 0 1 1 0 0 0 1 0
0 0 1 10. After execution of the following statement, which
of the following are true? int number[] = new int[5];
number[0] is undefined number[4] is null
number.length() is 6 number[2] is 0 (*) 11. The following
array declaration is valid:int[] y = new int[5]; True
(*) False 12. The following array declaration is valid. True
or false?int k[] = new int[10]; True (*)
False 13. The following array declaration is valid. True or false?; int x[] =
int[10]; True False (*) 14. 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];
True (*) False 15. Which of the following declares a one
dimensional array named names of size 8 so that all entries can be Strings?
String[] names=new String[8]; (*)
String[] name=new Strings[8]; String[] name=String[8];
String names=new String[8]; 1. In an if-else construct the condition to be
evaluated must end with a semi-colon. True or false?
True False (*) 2. The three logic operators in Java are:
!=,=,== &&, ||, ! (*)
&&,!=,= &,|,= 3. How would you use the ternary
operator to rewrite this if statement?if (gender == "female")
System.out.print("Ms.");elseSystem.out.print("Mr.");
(gender == "female") ? "Mr." :
"Ms." ; (gender == "female") ?
"Ms." : "Mr." ; System.out.print(
(gender == "female") ? "Ms." : "Mr." ); (*)
System.out.print( (gender == "female") ?
"Mr." : "Ms." ); 4. Which of the following correctly
matches the switch statement keyword to its function? case:
signals what code is executed if the user input matches the specified element
(*) switch: tells the compiler the value to compare the
input against if: records the user's input and sends it to
the case statements to find a possible match switch:
identifies what element will be compared to the element of the case statements
to find a possible match (*) default: signals what code to
execute if the input does not match any of the cases (*) 5. The following code
fragment properly implements the switch statement. True or
false?default(input)switch '+':answer+=num;break;case '-':answer-=num;break;!defaultSystem.out.println("Invalid
input"); True False (*) 6.
Which of the two diagrams below illustrate the correct syntax for variables
used in an if-else statement? Example A (*)
Example B 7. How would you use the ternary operator to rewrite this if
statement?if (balance < 500)fee = 10;elsefee = 0;
fee = ( balance >= 5) ? 0 : 10; fee = ( balance < 500)
? 0 : 10; fee = ( balance >= 500) ? 10 : 0;
fee= ( balance < 500) ? 10 : 0; (*)
fee = ( balance > 5) ? 10 : 0; 8. What is the difference between the symbols
= and == ? The symbol = is used in if statements and
== is used in loops. The symbol == is used to assign values
to variables and the = is used in declarations. The = is use
to assign values to variables and the == compares values. (*)
There is no difference. 9. For both the if-else construct
and the for loop, it is true to say that when the condition statement is met,
the construct is exited. True or False? True
False (*) 10. The syntax below represents a valid initialization of a for loop
counter. True or False?public class ForLoop {public static void main (String
args[]){for (int i=10; i <20; i++){System.out.println("i: "+i);
}}} True (*) False 11. Which of the
following is true about a do-while loop? It is a post-test
loop. It is a modified while loop that allows the program to
run through the loop once before testing the boolean condition.
It continues looping until the condition becomes false.
All of the above. (*) 12. What is one significant difference
between a while loop and a do-while loop? A DO-WHILE
loop includes an int that serves as a counter and a WHILE loop does not.
A DO-WHILE loop will always execute the code at least once,
even if the conditional statement for the WHILE is never true. A WHILE loop is
only executed if the conditional statement is true. (*)
There is no difference between a DO-WHILE loop and a WHILE loop.
A DO-WHILE loop does not exist in Java and a WHILE loop
does. 13. In a for loop the counter is not automatically incremented after each
loop iteration. Code must be written to increment the counter. True or false?
True (*) False 14. Which of the
following best describes a while loop? A loop that is
executed repeatedly until the conditional statement is false. (*)
A loop that contains a counter in parenthesis with the
conditional statement. A loop that contains a segment of
code that is executed before the conditional statement is tested.
A loop that executes the code at least one time even if the
conditional statement is false. 15. Which of the following correctly
initializes a for loop that executes 5 times? for(int
i = 1; i < 6; i++) (*) for(int i = 0; i < 5; I++)
for(int i = 1; i < 5; I++) for(int i =
0; i == 6; i++) 1. What is the purpose of the Eclipse Editor Area and Views?
To modify elements. (*) To choose the
file system location to delete a file. To navigate a
hierarchy of information. (*) 2. When converting gallons to liters its best to
put the calculation result into a variable with a _______________ data type.
int double (*)
boolean None of the above 3. What symbols are required for a
compiler to ignore a comment? /*/
/* */ // (*) 4. Select the statement that
declares a number of type double and initializes it to 6 times 10 to the 5th
power. double number=6*10^5; double
number=6e5; (*) double number=6(e5);
double number=6*10e5; 5. What is the output of the following lines of code? int
j=7,k=5,m=8,result;result=j/m*k;System.out.println(result);
0 (*) 4.375 0.175 280
6. What does the following program output total cost: 48
total cost: 40 (*) total cost: + 40
"total cost: " 40 "total cost: " 48 7.
Which of the following is a legal identifier? apple
(*) 7up grand Total
boolean 8. Examine the following code: What is the value of variable x?
2 (*) 14 6
2.5 9. Which of the two diagrams below illustrate the general
form of a Java program? Example A
Example B (*) 10. The following defines a class keyword:
Precedes the name of the class. (*) Defines where this class
lives relative to other classes, and provides a level of access control.
Provides the compiler information that identifies outside
classes used within the current class. 11. The following defines a package
keyword: Precedes the name of the class.
Provides the compiler information that identifies outside classes used within the
current class. Defines where this class lives relative to
other classes, and provides a level of access control. (*) 12. The following
defines a class keyword: Defines where this class lives
relative to other classes, and provides a level of access control.
Provides the compiler information that identifies outside
classes used within the current class. Precedes the name of
the class. (*) 13. Which of the following creates a String reference named str
and instantiates it? String str; String
str=new String("str"); (*) String
s="str"; str="str"; 14. The == operator
tests if two String references are pointing to the same String object. True or
false? True (*) False 15. The following
code prints 5 "a"'s to the screen: True
False (*) 1. Which of the following procedures turns an
object to face another object? turnToFace (*)
moveToward turn
orientToUpright 2. When you disable a programming instruction, it is still
executed when you run the Alice animation. True or false?
True False (*) 3. Which of the following is a reason why you
might disable programming statements in your Alice code?
To disable the entire program. To
make an object move forward. To help isolate portions of code
during testing. (*) To make an object turn and move
simultaneously. 4. From your Alice lessons, random numbers are numbers
generated by the user with a pattern in their sequence. True or false?
True False (*) 5. From your Alice
lessons, random numbers are set in the distance and duration arguments in a
procedure. True or false? True (*) False
6. From your Alice lessons, a flowchart could be created in a software
program, or documented in a journal. True or false? True (*)
False 7. From your Alice lessons, which of the following is
a tool to show the logic of an animation? Pie chart
Scene editor Class chart
Visual storyboard Flowchart (*) 8. Which
of the following is a reason why procedural abstraction may be used in
programming an animation? The code is too long. (*)
The code is difficult to read. (*) The
programmer wants to reuse the code. (*) The programmer wants
to save the animation. 9. Alice 3 will periodically remind you to save your project.
True or false? True False (*) 10.
In Alice, what does the resize handle style do? Move along
the x, y, and z axes Rotate about the x, y, and z axes
Change size of the object and stretch it along the x, y, and
z axes (*) Simple rotation and movement 11. From your Alice
lessons, what is a one-shot procedural method? A procedure
that is invoked when the Run button is clicked. A procedure
that is used to launch the program. A procedure that is
dragged into the Code editor. A procedure that is used to
make a scene adjustment. (*) 12. In Alice, when using the getDistanceTo
function what menu option would you use to subtract a set value from the
distance? Whole to decimal number
Custom DecimalNumber Random Math (*) 13.
In Alice, functions ask questions about an object. True or false?
True False (*) 14. In Alice, a walking
motion for a bipedal object can be achieved without the Do Together control
statement. True or false? True False (*)
15. In Alice, a computer program requires functions to tell it how to perform
the procedure. True or false? True False
(*) 16. A variable is a named location inside the computer's memory; once
there, the information can be retrieved and changed. True or false?
True (*) False 17. In Alice, there is no
way of seeing the code as Java code. True or false? True
False (*) 18.When creating an event based on a keypress
which event handler would you use? Position/Orientation
Mouse Scene Activation/Time
Keyboard (*) 19. With keyboard controls, you can create
Alice animations where the user controls an object that interacts with other
objects. True or false? True (*) False
20. A conditional loop is a loop that will continue forever. True or false?
True False (*) 21. In Alice, when
using a while loop you can only execute a single line of code within it. True
or false? True False (*) 22. 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? 1. Identify the detailed steps for the
science concept. 2. Present the problem as an animation.
Present the problem as an animation. 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 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. (*) 23. What should
you refer to for the animation's design specifications as you program your
Alice animation? Code Scene editor
Storyboard (*) Scenario 24. From your
Alice lessons, at what point in the animation process do you confirm the items
on the "Checklist for Animation Completion"?
After adding each procedure to the Code editor. At the end
of the animation process. (*) At the beginning of the
animation process. During the animation process. 25. When
you want specific code to be executed only if certain conditions are met, what
type of Java construct would you use? boolean
if (*) array while
loop 26. What do lines 9 and 11 do in the following code?
Accept user input and store them in the variables num1 and num2. (*)
Scan the next page in the scanner.
Examine a file and scan the next line. None of the above.
27. Examine the following code. What are the variables? args
(*) n (*) t (*) i (*)
28. Which of the following does not describe variables?
Has a type associated with it. Has
a unique name. Arranged in rows and columns. (*)
A place in memory where data of a specific type can be
stored for later retrieval and use. 29. In Alice, which of the following
programming statements moves the butterfly forward, double the distance to the
tree? this.Butterfly move backward {this.Butterfly getDistanceTo
this.Tree * 2} this.Butterfly move forward {this.Butterfly
getDistanceTo this.Tree / 2} this.Butterfly move forward
{this.Butterfly getDistanceTo this.Tree * 2} (*)
this.Butterfly move backward {this.Butterfly getDistanceTo this.Tree / 2} 30.
In Alice, which of the following programming statements moves the fish forward,
the distance to the rock, minus the depth of the rock?
this.Rock move forward {this.Rock getDistanceTo this.Fish - this.Fish - 2}
this.Fish move forward {this.Fish getDistanceTo this.Rock -
this.Rock getDepth} (*) this.Fish move forward {this.Rock
getDistanceTo this.Fish - this.Fish getDepth} this.Fish move
forward {this.Rock getDistanceTo this.Fish - this.Fish - 2} 31. In Greenfoot,
which of the following options are not possible when associating an image file
with an instance? Import an image Select
an image from the Greenfoot library Add a video (*)
Draw an image 32. In Greenfoot, methods can be called in the
act method. When the Act button is clicked in the environment, the methods in
the method body of the act method are executed. True or false?
True (*) False 33. Using the
Greenfoot IDE, only five instances can be added to a scenario. True or false?
True False (*) 34. In the Greenfoot IDE, an instance's
position is on the x and y coordinates. True or false?
True (*) False 35. An if-statement requires which type of
information returned from the condition? Integer
Method True or false (*) Action 36. From
your Greenfoot lessons, source code is written in the Code editor. True or
false? True (*) False 37.In
Greenfoot to create a new instance of a class, you right-click on the class,
then select which of the following commands in the class menu?
New subclass... new Duke() (*)
Set image... Inspect Duke()
Remove Duke() 38. What does an instance of the World class
do? Provide the source code for instances.
Provide the background scenery for the scenario. (*) Provide
the superclass for acting objects. Provide the acting
objects for the scenario. 39. In Greenfoot, which of the following are
execution controls? Act (*) Move
Turn Speed (*) Run (*)
40. In Greenfoot, after a subclass is created and compiled, you cannot edit the
subclass's source code. True or false? True
False (*) 41. From your Greenfoot lessons, how do you know
the program does not contain syntax errors? Review the
documentation. Inspect the instances.
Compile the code. (*) Write the code. 42. From your
Greenfoot lessons, which axes define an object's position in a world?
y (*) z w
x (*) 43. In Greenfoot, the origin of the world coordinate
system (0,0) starts in the center of the world. True or false?
True False (*) 44. From your Greenfoot lessons, classes can
only use the methods they have inherited. They cannot use methods from other
classes. True or false? True False (*)
45. From your Greenfoot lessons, which of the following comparison operators
represents "greater than"? <
= = > (*) ! = 46.
In Greenfoot, you can only interact with the scenario using a keyboard.
True False (*) 47. What type of parameter
does the Greenfoot playSound method expect? name of the
class (as String) name of a sound file (as String) (*)
name of a keyboard key (as String) name
of an integer (as int) 48. What type of parameter does the keyDown method
expect? The name of the sound file to play when the key is
pressed. 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. 49. Use your
Greenfoot knowledge to answer the question. One reason to write a defined
method in a class is to make it easier to read. True or false?
True (*) False 50. In Greenfoot a
collision is when 2 actors touch? True (*)
False 51. In Greenfoot, which of the following statement is
true about Defined Methods? A defined method is only relevant
to the Greenfoot Development team. A defined method only
relates to the World class. A defined method must be called
by your source code, normally in the Act method. (*) A
defined method is automatically executed once created. 52. In Greenfoot, which
method body correctly adds an instance of the World to a scenario, with size x
= 300 y = 300 and a resolution of 2 pixels per cell?
Super(300,300,2); super(300,300,2); (*)
world(300, 300, 2); super(2,300,300); 53. When you re-initialize
a scenario, Greenfoot automatically displays an instance of the World subclass
in the scenario. True or false? True (*)
False 54.Which of the following answers have the correct syntax for declaring a
class variable in Greenfoot? private variable-name,
variable-type; public variable-type variable-name; (*)
private variable-type variable-name; (*)
public variable-name variable type; 55. Use your Greenfoot knowldege: If an
Actor class Fly has a variable defined to store the current speed, which of the
following statements would successfully add a Fly and define the current speed
as 2? addObject (new Fly(2, 90), 150, 150);
addObject (new Fly(2), 150, 150); (*)
addObject (new Fly(), 150, 150); addObject (new Fly(), 2,
150, 150); 56. Abstraction occurs in many different ways in programming. True
or false? True (*) False 57. In
Greenfoot, you can cast an Actor class to a World class?
True False (*) 58. In Greenfoot,
what happens if the end to a while loop isn't established?
The code will prompt you to enter a loop counter. The code
will execute once and then stop, due to controls in Greenfoot.
The code will keep executing and will never stop. (*)
The code will not execute. 59. In Greenfoot, when is a local
variable most often used? Within loop constructs (*)
Within the scenario Within the act method
Within the world constructor 60. From your Greenfoot lessons,
which symbol represents string concatenation? Symbol =
Symbol < Symbol + (*)
Symbol & 61. The following code prints 5 "a"'s
to the screen: True False (*) 62.
Consider the following code snippet String forest = new
String("Black");
System.out.println(forest.length()); What is printed?
Forest 7 6
Black 5 (*) 63. Which of the following
creates a String reference named s and instantiates it?
String s=""; (*) String
s; String s=new String("s"); (*)
s="s"; 64. Which of the following defines a driver
class? 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
objects. None of the above. 65. Which of the following
defines a driver class? 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 objects. None of the above. 66. Which of
the two diagrams below illustrate the general form of a Java program?
Example A Example B (*) 67. The following
defines an import keyword: Precedes the name of the class.
Provides the compiler information that identifies outside
classes used within the current class. (*) Defines where
this class lives relative to other classes, and provides a level of access
control. 68. Select the statement that declares a number of type double and
initializes it to 6 times 10 to the 5th power. double
number=6*10^5; double number=6*10e5;
double number=6e5; (*) double number=6(e5); 69. What does
the following program output? "total cost: " 48
total cost: 48 total cost: + 40
"total cost: " 40 total cost:
40 (*) 70. Which of the following is the name of a Java primitive data type?
Rectangle Object
String int (*) 71. Which of the following statements
correctly assigns "3 times 10 to the 4th power" to the variable
number? double number=3(e4); double
number=3*10^4; double number=3*10e4;
double number=3e4; (*) 72. Which of the following is the name of a Java
primitive data type? double (*)
Rectangle Object String 73. In Eclipse,
when you run a Java Application, the results may be displayed in the Console
View. True or False? True (*) False 74.
In Eclipse, when you run a Java Application, the results are displayed in a new
window. True or False? True False
(*) 75. What is the purpose of the Eclipse Editor Area and Views?
To navigate a hierarchy of information. (*)
To modify elements. (*) To choose the
file system location to delete a file. 76. Which of the two diagrams below
illustrate the correct syntax for variables used in an if-else statement?
Example A (*) Example B 77.What
will print if the following Java code is executed? 5
4 0 3 (*) 78. Which of
the following expressions will evaluate to true when x and y are boolean
variables with opposite values? I. (x || y) && !(x
&& y) II. (x && !y) || (!x && y)
III. (x || y) && (!x ||!y) I only
II only I and III II
and III I, II, and III (*) 79. How would you use the ternary
operator to rewrite this if statement? if (gender ==
"female") System.out.print("Ms."); else
System.out.print("Mr.");
(gender == "female") ? "Ms." : "Mr." ;
System.out.print( (gender == "female") ?
"Mr." : "Ms." ); (gender ==
"female") ? "Mr." : "Ms." ;
System.out.print( (gender == "female") ? "Ms." :
"Mr." ); (*) 80. In an if-else construct, the condition to be
evaluated must be contained within parentheses. True or False?
True (*) False 81. switch statements work
on all input types including, but not limited to, int, char, and String. True
or false? True False (*) 82. The
six relational operators in Java are:
>,<,=,!,<=,>= >,<,==,!=,<=,>= (*)
>,<,=,!=,<=,>=
>,<,=,!=,=<,=> 83. Determine whether this boolean expression
evaluates to true or false: !(3 < 4 && 6 > 6
|| 6 <= 6 && 7 - 2 == 6) True (*)
False 84. Which of the following is true about a do-while
loop? It is a post-test loop. It is
a modified while loop that allows the program to run through the loop once
before testing the boolean condition. It continues looping until
the condition becomes false. All of the above. (*) 85. How
many times will the following loop be executed? What is the
value of x after the loop has finished? What is the value of
count after the loop has finished? int count = 17;
int x = 1; while(count > x){
x*=3; count-=3; }
3; 27; 8 (*) 5; 30; 5
4; 8; 27 3; 9; 11 5;
27; 8 86. Updating the input of a loop allows you to implement the code with
the next element rather than repeating the code always with the same element.
True or false? True (*) False 87. The
syntax below represents a valid initialization of a for loop counter. True or
False? public class ForLoop { public
static void main (String args[]) { for
(int i=10; i <20; i++) {System.out.println("i:
"+i); } } }
True (*) False 88. A counter used in a for loop cannot be
initialized within the For loop statement. True or False?
True False (*) 89. In a for loop, the counter is
automatically incremented after each loop iteration. True or False?
True False (*) 90. Which of the following
correctly initializes a for loop that executes 5 times?
for(int i = 1; i < 6; i++) (*) for(int i = 0; i == 6;
i++) for(int i = 1; i < 5; I++)
for(int i = 0; i < 5; I++) 91. What is wrong with this code?
It gives you an out of bounds exception.
There is nothing wrong with this code. It
does not compile. (*) It is missing a semicolon. 92. Which
of the following would give you an array index out of bounds exception?
Using a single equal symbol to compare the value of
two integers. Refering to an element of an array that is at
an index less than the length of the array minus one.
Refering to an element of an array that is at an index greater than the length
of that array minus one. (*) Unintentionally placing a
semicolon directly after initializing a for loop.
Misspelling a variable name somewhere in your code. 93. Which of the following
defines an Exception? A problem that can be corrected
or handled by your code. (*) An interpreter reading your
code. Code that has no errors and therefore runs smothly.
A very severe non-fixable problem with interpreting and
running your code. 94. A computer company has one million dollars to give as a
bonus to the employees, and they wish to distribute it evenly amongst them.
The company writes a program to calculate the amount each
employee receives, given the number of employees.
Unfortunately, the employees all went on strike before they heard about the
bonus. This means that the company has zero employees. What
will happen to the program if the company enters 0 into the employment number?
An exception will occur because it is not possible to divide
by zero. (*) An unfixable error will occur.
The program will calculate that each employee will receive
zero dollars because there are zero employees. The
programmers will have proven their worth in the company because without them
the company wrote faulty code. 95. If an exception has already been thrown,
what will the interpreter read next in the program? The user
input. Where the program catches the exception. (*)
The next line of the program even if it is not the catch
block of code. The end of the program. 96. What will be the
content of the array variable table after executing the following code?
1 0 0 1 1 0 1 1
1 (*) 1 0 0 0 1 0 0 0
1 0 0 1 0 1 0 1 0 0
1 1 1 0 1 1 0 0 1 97.
What is the output of the following segment of code? 642
642246 (*) This code doesn't compile.
321123 312213 98. The following segment
of code prints all five of the command line arguments entered into this
program. True or false? True False
(*) 99. What is the output of the following segment of code if the command line
arguments are "apples oranges pears"? 3 (*)
0 This code does not compile.
2 1 100. Which of the following declares
and initializes a one dimensional array named values of size 5 so that all
entries contain 1? int[] values={1};
int[] values={1,1,1,1,1}; (*) int
values={1,1,1,1,1}; int values[]={1,1,1,1,1,1}; 101. The
following segment of code initializes a 2 dimensional array of references. True
or false? String[][] array={{"a",
"b", "C"},{"a", "b", "c"}};
True (*) False 102. Which of the
following declares and initializes a one dimensional array named words of size
3 so that all entries can be Strings? String[] words=new
String[3]; String[]
words={"Over","the","mountain"}; (*)
String strings=new String[3]; String[]
words={"Oracle","Academy"}]; 103. Which of the following
statements print every element of the one dimensional array prices to the screen?
for(int i=0; i <= prices.length;
i++){System.out.println(prices[i]);} for(int i=0; i <
prices.length; i++){System.out.println(prices[i]);} (*)
for(int i=1; i <= prices.length; i++){System.out.println(prices[i]);}
System.out.println(prices.length); 104. What is the output
of the following segment of code if the command line arguments are "apples
oranges pears"? args apples
pears (*) oranges This
code does not compile. 105. Which of the following statements is a valid array
declaration? counter int[]; float
average[]; (*) double[] marks; (*) int
number(); 106. Which of the following creates a method that compiles with no
errors in the class? 1 public class thisClass{
2 private int a=4, b=5; 3 public int
calculate(){a=a+b; return a;}} 107. What is wrong with the following class
declaration? class Account{
private int number; private String name;
public Account; }
There is nothing wrong. The constructor
method has no definition. (*) Classes cannot include mixed
data types. Classes cannot include strings. 108. All
objects, in Java, are created using int. True or false? True
False (*) 109. What does it mean to inherit a class?
A way of organizing the hierarchy of classes.
Extending a method from a superclass. The
access specifier has been set to private. The subclass (or
child class) gains access to any non-private methods and variables of the
superclass (or parent class). (*) 110. Where should the constructor for a
superclass be called? The super constructor does not need to
be called inside the subclass. The last line in the
constructor of the subclass. The first line of the
constructor in the subclass. (*) Inside the main method of
the subclass. Anywhere inside the subclass. 111. Which of
the following is the proper way to set the public variable length of the super
class equal to 5 from inside the subclass? super.length(5)
super.length = 5 (*) super(length = 5)
super.length() = 5 112. Which of the following statements about static methods
is true? They can access any instance variable.
They exist once in each instance. They can
be overridden by a subclass. They cannot access static
variables declared outside the method. They exist once per
class. (*) 113. A final static variable can change at runtime. True or false?
True False (*) 114. Static methods
can return any object type. True or false? True (*)
False 115. If a class is immutable then it must be abstract.
True or false? True False (*) 116. Which
of the following are true about abstract methods? They must
be overridden in a non-abstract subclass. (*) They cannot
have a method body. (*) They must be overloaded.
They must be declared in an abstract class. (*)
They may contain implementation. 117. If we override the
toString() method with the code below, what would be the result of printing?
It would print the array backwards. The console screen would
display: 42 11 64 215 18 0 It would print the string
returned from the method. The console screen would display:
[0,18,215,64,11,42,] (*) It would print the array one
element at a time. The console screen would display: 0 18 215 64 11 42
It would print the string returned from the method. The
console screen would display: {0, 18, 215, 64, 11, 42} 118. Which of the
following is the definition for a variable argument method?
Specifies accessibility to code. A
type of argument that enables calling the same method with a different number
of arguments. (*) A way to create a new class.
Having more than one constructor with the same name but
different arguments. 119. Which of the following could be a reason to return an
object? Because you wish to be able to use that object
inside of the method. It has faster performance than
returning a primitive type. The method makes changes to the
object and you wish to continue to use the updated object outside of the
method. (*) None of the above. It is not possible to return
an object. 120. Which of the following is the definition of a constructor?
A way to call a method with a variable number of arguments
using an elipse. A variable in a method declaration that
gets passed into the method. A keyword that specifies
accessibility of code. A special method that is used to
assign initial values to instance variables in a class. (*)
Cheap Offers: http://bit.ly/gadgets_cheap
Cheap Offers: http://bit.ly/gadgets_cheap
1.
Which of the
following is not a type of event listener in Alice? Mark for
Review
(1)
Points
Keyboard
Scene Activation/Time
Mouse
Position/Orientation
Cursor (*)
2.
In Alice, what tab
would you choose to start a new animation with a pre-populated
world? Mark for Review
(1)
Points
Blank Slate
Starters (*)
Recent
My Projects
3.
In Alice, you can
access the Java on the side option through which menu
option?
Mark for Review
(1)
Points
Window (*)
Project
Run
Edit
4.
From your Alice
lessons, variables are fixed and cannot be changed. True or
false? Mark for
Review
(1)
Points
True
False (*)
5.
You have a Class
representing Cat. A cat can meow, purr, catch mice, and so on. When you create
a new cat, what is it
called?
Mark for Review
(1)
Points
A subprogram
A submethod
A subclass
A variable class
An instance (*)
Section
2
(Answer all questions in this section)
6.
Which 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.
7.
In Alice, the use
of conditional control structures allows what two types of
loops? Mark
for Review
(1)
Points
(Choose all correct answers)
conditional (*)
together
infinite
switch
8.
From your Alice
lessons, where on an object do an object's axes
intersect? Mark for Review
(1)
Points
At the object's head
At the object's bottom
At the object's chest
At the object's center point (*)
9.
Which of the
following are examples of elements you would test in your Alice
animation?
Mark for Review
(1)
Points
(Choose all correct answers)
Math expressions calculate as expected. (*)
All of the procedures display in alphabetical order in the Procedures tab.
Event listeners trigger the correct responses. (*)
Objects move with smooth timing. (*)
10.
What type of Alice listener object
is required to target a mouse-click on any object in the scene, allowing the
user to drag that object around the scene when the animation is
running? Mark for
Review
(1)
Points
addMouseListener procedure
addListener procedure
addDefaultManipulation procedure
addDefaultModelManipulation procedure (*)
Section
2
(Answer all questions in this section)
11.
In Alice, which of the following
arguments could be replaced with a random number? Mark for
Review
(1)
Points
(Choose all correct answers)
Direction
Duration (*)
Distance (*)
Object name
Procedure name
12.
Alice uses built-in math operators.
They are: Mark for Review
(1)
Points
Add
Subtract
Multiply
Divide
All of the above (*)
13.
In Alice, which of the following
programming statements moves the butterfly forward, double the distance to the
tree? Mark for Review
(1)
Points
this.Butterfly move backward {this.Butterfly getDistanceTo this.Tree * 2}
this.Butterfly move forward {this.Butterfly getDistanceTo this.Tree / 2}
this.Butterfly move forward {this.Butterfly getDistanceTo this.Tree * 2} (*)
this.Butterfly move backward {this.Butterfly getDistanceTo this.Tree / 2}
14.
In Alice, which function is used to
move an object directly to the center point of another
object?
Mark for Review
(1)
Points
getDuration
getDistance (*)
getDepth
getObject
15.
When you disable a programming
instruction, it is still executed when you run the Alice animation. True or
false? Mark for Review
(1)
Points
True
False (*)
Section
2
(Answer all questions in this section)
16.
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
17.
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
18.
In Alice, a walking motion for a
bipedal object can be achieved without the Do Together control statement. True
or false? Mark for Review
(1)
Points
True
False (*)
19.
In Alice, what are the forms of a
scenario? Mark for
Review
(1)
Points
(Choose all correct answers)
A task to perform. (*)
A person to help.
A problem to solve. (*)
A section of code to write.
A system to start.
20.
In Alice, when a new procedure is
declared, all subclasses of the superclass will inherit the procedure. True or
false?
Mark for Review
(1)
Points
True (*)
False
Section
2
(Answer all questions in this section)
21.
Procedural abstraction may need to
be implemented if an object in Alice needs to perform an action, but there
isn't an inherited procedure that accomplishes that action. True or false? Mark
for Review
(1)
Points
True (*)
False
22.
The list below describes variables.
All are correct except which one? Mark for
Review
(1)
Points
Has a type associated with it.
Has a unique name.
A place in memory where data of a specific type can be stored for later
retrieval and use.
Arranged in rows and columns. (*)
23.
The list below displays valid
primitive types in Java, except which one? Mark for Review
(1)
Points
String (*)
int
double
long
boolean
24.
Alice 3 will periodically remind you
to save your project. True or false? Mark for Review
(1)
Points
True
False (*)
Section
3
(Answer all questions in this section)
25.
In Greenfoot, which of the following
methods return the world that the instance lives
in? Mark for
Review
(1)
Points
World getWorld() (*)
World getClass()
getXY()
getRotation()
Section
3
(Answer all questions in this section)
26.
From your Greenfoot lessons, in an
if-statement, the programming statements written in curly brackets are executed
simultaneously. True or
false?
Mark for Review
(1)
Points
True
False (*)
27.
In Greenfoot you can only access the
methods of the current class? Mark
for Review
(1)
Points
True
False (*)
28.
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
only if one of its operands are true.
Compares two boolean values, and returns a boolean value which is true if and
only if both 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.
29.
In Greenfoot, which of the following
statements could prevent an infinite loop from
occurring?
Mark for Review
(1)
Points
I = 100 + i
i = i + 1 (*)
i = i
i=1
30.
In Greenfoot, a local variable is
declared at the beginning of a class. True or
false? Mark
for Review
(1)
Points
True
False (*)
Section
3
(Answer all questions in this section)
31.
In Greenfoot, what types of values
cannot be stored in a local
variable?
Mark for Review
(1)
Points
Method (*)
Integers
Objects
Class name
World name
32.
Which of the following type of
audience should you ask to play your Greenfoot game during the testing phase?
Mark for Review
(1)
Points
Testing
Programmer
Target (*)
Primary
33.
In object oriented programming,
programmers analyze a problem and create objects to solve the problem. True or
false? Mark for Review
(1)
Points
True (*)
False
34.
Which one of the following can be
used to detect when 2 actors
collide?
Mark for Review
(1)
Points
isCollision()
hasCollided()
isContact()
isTouching() (*)
35.
In Greenfoot, a way to have all
subclasses of a superclass inherit a method is by adding the method to the
superclass. True or
false?
Mark for Review
(1)
Points
True (*)
False
Section
3
(Answer all questions in this section)
36.
What type of parameter does the
Greenfoot playSound method
expect? Mark
for Review
(1)
Points
name of a keyboard key (as String)
name of a sound file (as String) (*)
name of the class (as String)
name of an integer (as int)
37.
Greenfoot has tools to record sound.
True or false? Mark for Review
(1)
Points
True (*)
False
38.
Which of the following answers have
the correct syntax for declaring a class variable in
Greenfoot? Mark for Review
(1)
Points
(Choose all correct answers)
public variable-name variable type;
public variable-type variable-name; (*)
private variable-name, variable-type;
private variable-type variable-name; (*)
39.
In Greenfoot, which method is used
to add a new instance to a scenario when the world is initialized?
Mark for Review
(1)
Points
addObject (*)
addClass
addWorld
addInstance
40.
Constructors are called
automatically when a new intance of a class is created? True or
false? Mark for Review
(1)
Points
True (*)
False
41.
In Greenfoot, the instance has a
source code editor. True or
false? Mark for Review
(1)
Points
True
False (*)
42.
In Greenfoot, the move method
expects what type of information in its parameters? Mark for
Review
(1)
Points
Integer of steps to move forward (*)
Degrees to turn
String statement
True or false response
43.
Using the Greenfoot IDE, only five
instances can be added to a scenario. True or false? Mark for Review
(1)
Points
True
False (*)
44.
In Greenfoot, the body of the method
is located in between which of the following
characters?
Mark for Review
(1)
Points
Curly brackets { } (*)
Square brackets [ ]
Asterisks **
Parnetheses ( )
45.
In Greenfoot, a subclass is a
specialization of a superclass. True or
false?
Mark for Review
(1)
Points
True (*)
False
Section
3
(Answer all questions in this section)
46.
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
47.
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
48.
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 (*)
49.
The first step to executing an
if-else statement is to:____________. Mark for Review
(1)
Points
Execute the else statement
Evaluate the class
Execute the if statement
Evaluate the condition (*)
50.
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 both. True or false? Mark for
Review
(1)
Points
True (*)
False
Section
2 Oracle Java Fundamentals Quiz
Section
2 - Quiz 1 L1-L7
(Answer
all questions in this section)
1. In
Alice, which control statement is used to invoke simultaneous
movement? Mark for Review
(1)
Points
Do
In Order
Count
Do
Together
(*)
While
Variable
2. 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
(*)
3. Manually
manipulating an Alice object with your cursor is a way to precisely position an
object. True or false? Mark for Review
(1)
Points
True
False
(*)
4. Only
acting objects have one-shot procedures. True or
false? Mark
for Review
(1)
Points
True
False
(*)
5. In
Alice, where are objects added and positioned in the
scene? Mark for Review
(1)
Points
The
template
The
Scene editor (*)
The
Code editor
The
gallery
6. Before
you can begin to develop the animation storyboard, what must be
defined? Mark
for Review
(1)
Points
The
debugging process
The
control statements
The
code
The
scenario (*)
7. In
Alice, which of the following are benefits of separating out motions into their
own
procedures? Mark
for Review
(1)
Points
(Choose
all correct answers)
It
makes the scene easier to view.
It
can allow subclasses of a superclass to use a procedure. (*)
It
simplifies code and makes it easier to read. (*)
It
makes the animation easier to run.
It
allows many objects of a class to use the same procedure. (*)
8. Which
Alice tool is used to demonstrate the process flow of an animation? Mark
for Review
(1)
Points
World
Pie
chart
Textual
storyboard
Visual
storyboard
Flowchart
(*)
9. Which
Alice execution task corresponds with the following storyboard statement?
Cat turns to face mouse. Mark for Review
Cat turns to face mouse. Mark for Review
(1)
Points
mouse
turnTo cat
this.cat
turnToFace this.mouse (*)
this.mouse
turnToFace this.cat
cat
TurnTo mouse
10. From
your Alice lessons, which control statement executes instructions
simultaneously? Mark for Review
(1)
Points
Do
in order
Variable
Do
together (*)
Count
11. From
your Alice lessons, built-in functions provide precise property details for the
following
areas: Mark
for Review
(1)
Points
Proximity
and point of view.
Distance
to and nesting.
Proximity
and size.
Proximity,
size, spatial relation, and point of view. (*)
12. From
your Alice lessons, which programming instruction represents the following
movement: A turtle moves forward half the distance to the
flower. Mark for
Review
(1)
Points
this.Turtle
move Forward this.Turtle getDistanceTo this.Flower * 2
this.Turtle
move Forward this.Turtle getDistanceTo this.Flower / 1.0
this.Turtle
move Forward this.Turtle getDistanceTo this.Flower / 0.5
this.Turtle
move Forward this.Turtle getDistanceTo this.Flower / 2.0 (*)
13. What
is the purpose of a function in Alice? Mark for Review
(1)
Points
To
position the object in the Scene editor.
To
save the project.
To
compute and answer a question about an object. (*)
To
define how the object should execute a task.
14. The
comments you enter in Alice should describe the sequence of actions that take
place in the code segment. True or
false? Mark
for Review
(1)
Points
True
(*)
False
15. Which
of the following is a reason why you might disable programming statements in
your Alice
code? Mark
for Review
(1)
Points
To
disable the entire program.
To
make an object move forward.
To
make an object turn and move simultaneously.
To
help isolate portions of code during testing. (*)
1.
From your Alice lessons, where
on an object do an object's axes intersect? Mark for Review
(1)
Points
At
the object's center point (*)
At
the object's head
At
the object's chest
At
the object's bottom
2. Only
acting objects have one-shot procedures. True or
false? Mark
for Review
(1)
Points
True
False
(*)
3. In
Alice, which of the following is not a control statement? Mark for Review
(1)
Points
Count
Move
(*)
While
Do
In Order
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
(*)
5. When
is an instance created in Alice? Mark for Review
(1)
Points
After
the scenario is saved.
After
the folder is selected in the gallery.
After
the class icon is dragged into the scene. (*)
After
the code is created.
6. Which
of the following is an example of nesting in an Alice
program? Mark for Review
(1)
Points
Five
Do Together statements are nested inside of a Do In Order statement. (*)
A
move procedure is nested inside of a turn procedure.
Distance,
duration, and direction arguments are nested inside of a procedure.
Text
is nested inside of a comments tile.
7. Which
Alice control statement executes a set of procedures
simultaneously? Mark
for Review
(1)
Points
Do
in order
While
Together
Do
together (*)
8. Programming
comments do not affect the functionality of your Alice animation. True or
false? Mark for Review
(1)
Points
True
(*)
False
9. What
is the first step to entering comments in an Alice
program? Mark for Review
(1)
Points
Select
the instance from the instance menu.
Drag
and drop the comments tile below a code segment.
Type
comments that describe the sequence of actions in the code segment.
Drag
and drop the comments tile above a code segment. (*)
10. In
Alice the Functions tab will display the pre-defined functions for the selected
instance. True or false? Mark for Review
(1)
Points
True
(*)
False
11. In
Alice, what function would you use to get a wholenumber from the
user? Mark for
Review
(1)
Points
getIntegerFromUser
(*)
getBooleanFromUser
getStringFromUser
getDoubleFromUser
12. In
Alice, there is no way of reordering the function list in the function tab.
True or false? Mark for Review
(1)
Points
True
False
(*)
13. Defining
the scenario, and the Alice animation to represent the scenario, is the first
step to programming your animation. True or false? Mark for Review
(1)
Points
True
(*)
False
14. In
Alice, declaring a new procedure to shorten code and make it easier to read is
a procedural abstraction technique. True or false? Mark for Review
(1)
Points
True
(*)
False
15. In
Alice, what are the forms of a scenario? Mark for Review
(1)
Points
(Choose
all correct answers)
A
problem to solve. (*)
A
task to perform. (*)
A
person to help.
A
system to start.
A
section of code to write.
1.
Before you can begin to develop
the animation storyboard, what must be
defined? Mark
for Review
(1)
Points
The
debugging process
The
control statements
The
scenario (*)
The
code
2. In
Alice, declaring a new procedure to shorten code and make it easier to read is
a procedural abstraction technique. True or false? Mark for Review
(1)
Points
True
(*)
False
3. A
scenario gives the Alice animation a purpose. True or
false? Mark for
Review
(1)
Points
True
(*)
False
4. From
your Alice lessons, which programming instruction represents the following
movement: A cat moves forward double (or twice) the distance to the
tree. Mark for Review
(1)
Points
this.Cat
move Forward this.Cat getDistanceTo this.tree / 2.0
this.Cat
move Forward this.Cat getDistanceTo this.tree - 2.0
this.Cat
move Forward this.Cat getDistanceTo this.tree * 2.0 (*)
this.Cat
move forward this.Cat getDistanceTo this.tree + 2.0
5. In
Alice, where you would you get access to the specific joints of an object that
are not available through the object drop down menu? Mark for Review
(1)
Points
scene
editor
procedures
tab
functions
tab (*)
code
editor
6. Only
acting objects have one-shot procedures. True or
false? Mark
for Review
(1)
Points
True
False
(*)
7. From
your Alice lessons, where on an object do an object's axes
intersect? Mark for Review
(1)
Points
At
the object's bottom
At
the object's chest
At
the object's head
At
the object's center point (*)
8. Which
Alice execution task corresponds with the following storyboard statement?
Cat turns to face mouse. Mark for Review
Cat turns to face mouse. Mark for Review
(1)
Points
this.cat
turnToFace this.mouse (*)
mouse
turnTo cat
cat
TurnTo mouse
this.mouse
turnToFace this.cat
9. 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
(*)
10. When
something is broken or doesn't work as intended in a software program, it is
referred to as a _________? Mark for Review
(1)
Points
Bug
(*)
Error
Code
Debug
11. Debugging
and testing is the process of running the animation one time, and adjusting the
control statements, procedures, and
arguments. Mark for Review
(1)
Points
True
False
(*)
12. In
Alice the Functions tab will display the pre-defined functions for the selected
instance. True or false? Mark for Review
(1)
Points
True
(*)
False
13. What
is the first step to programming an object to turn left in Alice? Mark
for Review
(1)
Points
Select
the object to program from the instance menu. (*)
Drag
the turn procedure into the Code editor.
Select
the duration for the object to turn.
Select
the distance to turn.
14. 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
15. Which
of the following actions would require a control statement to control animation
timing? Mark for Review
(1)
Points
(Choose
all correct answers)
A
biped object walking. (*)
A
rock object turning.
A
bird flying. (*)
A
fish swimming. (*)
1.
Define the value of the
variable LapCount based on the following math calculation: LapCount + 10 =
15 Mark for Review
(1)
Points
2
15
4
5
(*)
10
2. Which
of the following is not an Alice variable value type? Mark for
Review
(1)
Points
Whole
Number
Decimal
Number
Color
Function
(*)
3. In
Alice, what are the forms of a scenario? Mark for Review
(1)
Points
(Choose
all correct answers)
A
problem to solve. (*)
A
person to help.
A
task to perform. (*)
A
section of code to write.
A
system to start.
4. From
your Alice lessons, animations should be tested by the programmer before they
are considered complete. True or
false? Mark for
Review
(1)
Points
True
(*)
False
5. From
your Alice lessons, when testing your animation, you should test that comments
were added below each sequence of instructions in the code. True or
false? Mark for Review
(1)
Points
True
False
(*)
6. In
Java, a function is a method that must return a value. True or
false? Mark for Review
(1)
Points
True
False
(*)
7. Which
of the following does not describe methods? Mark for Review
(1)
Points
A
subprogram that acts on data and often returns a value.
A
set of code that is referred to by name.
Is
associated with an instance variable. (*)
Can
be called at any point in a program simply by utilizing its name.
8. In
Alice, we can avoid object collision using what? Mark for
Review
(1)
Points
Downloading
the Alice 3 collision detector app.
Using
object detection.
Using
math operators. (*)
Slowing
movements down.
9. Alice
uses built-in math operators; they are: Mark for Review
(1)
Points
Add
and subtract
Multiply
and divide
All
of the above (*)
None
of the above
10. In
Alice, what tab would you choose to start a new animation with a pre-populated
world? Mark
for Review
(1)
Points
Recent
Blank
Slate
Starters
(*)
My
Projects
11. In
Alice, when is the sceneActivationListener
executed? Mark for Review
(1)
Points
When
the user clicks on on object
At
the end of the animation
At
the beginning of the animation (*)
When
an object appears on screen
12. A
data type defines the type of procedures a variable can store. True or
false? Mark for Review
(1)
Points
True
False
(*)
13. If
a value has been assigned to (is stored in) a variable, that value will be
overwritten when another value is assigned to the variable using the assignment
"=" operator. True or false? Mark for Review
(1)
Points
True
(*)
False
14. In
Alice, the use of conditional control structures allows what two types of
loops? Mark for Review
(1)
Points
(Choose
all correct answers)
switch
together
conditional
(*)
infinite
15. In
Alice, which one of the following is not a pre-defined control
structure? Mark for Review
(1)
Points
do
in order
do
together
do
while (*)
while
1.
In Java, which symbol is used to assign one value to another? Mark
for Review
(1)
Points
<
=
(*)
>
//
2.
What is the output produced by the following code?
Mark for Review
(1)
Points
j
is 10
j
is 5
k
is 5
j
is 5
k
is 5 (*)
j
is 10
k
is 10
j
is 15
k
is 15
3.
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
if
(*)
array
while
loop
boolean
4.
If you need to repeat a group of Java statements many times, which Java
construct should you use? Mark for Review
(1)
Points
(Choose all correct answers)
while
loop (*)
do
while loop (*)
repeat...until
if
5.
In Alice it is not possible to transfer a class from one animation to
another. True or false? Mark for Review
(1)
Points
True
False
(*)
6.
You want an event to happen when an object collides with another object,
which category of event handler would you choose? Mark for
Review
(1)
Points
Keyboard
Mouse
Scene
Activation/time
Position/Orientation
(*)
7.
Which of the following is not an Alice variable value type? Mark
for Review
(1)
Points
Color
Decimal
Number
Function
(*)
Whole
Number
8.
The initializer of a variable with a TextString value type could be
(select all that apply): Mark for Review
(1)
Points
(Choose all correct answers)
"Greetings"
(*)
"Howdy"
(*)
"4"
(*)
None
of the above.
9.
Which of the following WHILE control structures commands the fish to
move forward repeatedly 0.5 meters at a time, but stop if it collides with the
shark? Mark for Review
(1)
Points
(*)
10.
In Alice, we use the WHILE control statement to implement the
conditional loop. True or false? Mark for Review
(1)
Points
True
(*)
False
11.
In Alice, which of the following programming statements moves the
butterfly forward, double the distance to the tree? Mark for
Review
(1)
Points
this.Butterfly
move forward {this.Butterfly getDistanceTo this.Tree / 2}
this.Butterfly
move backward {this.Butterfly getDistanceTo this.Tree * 2}
this.Butterfly
move forward {this.Butterfly getDistanceTo this.Tree * 2} (*)
this.Butterfly
move backward {this.Butterfly getDistanceTo this.Tree / 2}
12.
An example of an expression is: Mark for Review
(1)
Points
If
or Where
3*3=9
(*)
Move
forward 1 meter
"I
feel happy."
13.
From your Alice lessons, a textual storyboard provides a detailed,
ordered list of the actions each object performs in each scene of the
animation. True or false? Mark for Review
(1)
Points
True
(*)
False
14.
From your Alice lessons, when testing your animation, you should test
that comments were added below each sequence of instructions in the code. True
or false? Mark for Review
(1)
Points
True
False
(*)
15.
What can be used as a guideline to ensure your Alice animation fulfills
animation principles? Mark for Review
(1)
Points
An
animation checklist (*)
Other
programmers
The
Internet
A
close friend
1.
An event is any action initiated by
the user that is designed to influence the programοΎ’s execution during
play. Mark for Review
(1)
Points
True (*)
False
2.
In Alice, what tab would you choose
to start a new animation with a pre-populated
world? Mark for
Review
(1)
Points
Recent
Starters (*)
My Projects
Blank Slate
3.
Which of the following is not a
valid arithmetic operator in Java? Mark for Review
(1)
Points
+
/
-
*
%
$ (*)
None of the above
4.
If a value has been assigned to (is
stored in) a variable, that value will be overwritten when another value is
assigned to the variable using the assignment "=" operator. True or
false? Mark for Review
(1)
Points
True (*)
False
5.
In Java, a function is a method that
must return a value. True or false?
Mark for Review
(1)
Points
True
False (*)
6.
The list below contains method
descriptions. All are correct except which one?
Mark for Review
(1)
Points
(Choose all correct answers)
Is associated with an instance variable.
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.
7.
In Alice, we can avoid object
collision using what? Mark for Review
(1)
Points
Downloading the Alice 3 collision detector app.
Using math operators. (*)
Using object detection.
Slowing movements down.
8.
Alice uses built-in math operators;
they are: Mark for Review
(1)
Points
Add and subtract
Multiply and divide
All of the above (*)
None of the above
9.
Define the value of the variable
LapCount based on the following math calculation: LapCount + 10 =
15 Mark for Review
(1)
Points
2
5 (*)
15
4
10
10.
The initializer of a variable with a TextString
value type could be (select all that apply): Mark for
Review
(1)
Points
(Choose all correct answers)
"Greetings" (*)
"Howdy" (*)
"4" (*)
None of the above.
6.
The list below contains method
descriptions. All are correct except which one?
Mark for Review
(1)
Points
(Choose all correct answers)
Is associated with an instance variable.
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.
7.
In Alice, we can avoid object
collision using what? Mark for Review
(1)
Points
Downloading the Alice 3 collision detector app.
Using math operators. (*)
Using object detection.
Slowing movements down.
8.
Alice uses built-in math operators;
they are: Mark for Review
(1)
Points
Add and subtract
Multiply and divide
All of the above (*)
None of the above
9.
Define the value of the variable
LapCount based on the following math calculation: LapCount + 10 =
15 Mark for Review
(1)
Points
2
5 (*)
15
4
10
10.
The initializer of a variable with a TextString
value type could be (select all that apply): Mark for
Review
(1)
Points
(Choose all correct answers)
"Greetings" (*)
"Howdy" (*)
"4" (*)
None of the above.
15.
The Alice If control structure requires the false
statement to be populated. True or false? Mark for Review
(1)
Points
True
False (*)