Uts 31217

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

1.

If you need
Mark for Review
to repeat a
(1) Points
group of
Java
statements
many
times,
which Java
construct
should you
use?

(Choose all correct answers)

do while loop (*)

repeat...until

if

while loop (*)

Correct

2. The condition in a WHILE loop is a boolean expression. True or


Mark for Review
false?
(1) Points

True (*)

False

Correct

3. What should you refer to for the animation's design


Mark for Review
specifications as you program your Alice animation?
(1) Points

Scenario
Code

Storyboard (*)

Scene editor

Correct

4. From your Alice lessons, animations should be tested by the


Mark for Review
programmer before they are considered complete. True or false?
(1) Points

True (*)

False

Correct

5. From your Alice lessons, complete the following sentence: When


Mark for Review
coded, an event triggers a ___________.
(1) Points

Infinite loop

Scene

Procedure (*)

Gallery

Correct

6.To save a
Mark for Review
class to
(1) Points
the
myClasses
directory
you do so
at the
________
level.
eventListener

Scene

object

Class (*)

Correct

7. In Alice, when two objects are synchronized and move together,


Mark for Review
this means that one object is:
(1) Points

A class of another

An instance of another

An object of another

A vehicle of another (*)

Incorrect. Refer to Section 2 Lesson 6.

8. Which of the following actions would require a control statement


Mark for Review
to control animation timing?
(1) Points

(Choose all correct answers)

A fish swimming. (*)

A rock object turning.

A biped object walking. (*)

A bird flying. (*)


Incorrect. Refer to Section 2 Lesson 6.

9. In Alice, different programming is not required for different


Mark for Review
objects, because all objects move the same way. True or false?
(1) Points

True

False (*)

Incorrect. Refer to Section 2 Lesson 6.

10. What is the first step to programming an object to turn left in


Mark for Review
Alice?
(1) Points

Select the distance to turn.

Select the object to program from the instance menu. (*)

Select the duration for the object to turn.

Drag the turn procedure into the Code editor.

Incorrect. Refer to Section 2 Lesson 3.

11.A complete
Mark for Review
Alice
(1) Points
instruction
includes
which of the
following
components?

(Choose all correct answers)

Image

Class
Amount (*)

Direction (*)

Procedure (*)

Incorrect. Refer to Section 2 Lesson


4.

12. In Alice, the use of conditional control structures allows what


Mark for Review
two types of loops?
(1) Points

(Choose all correct answers)

conditional (*)

infinite

together

switch

Correct

13. Which of the following is not one of the positioning axes used
Mark for Review
in Alice 3?
(1) Points

w (*)

Correct
14. Results of arithmetic operations cannot be stored in a
Mark for Review
variable. True or false?
(1) Points

True

False (*)

Correct

15. The list below describes variables. All are correct except
Mark for Review
which one?
(1) Points

Arranged in rows and columns. (*)

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.

Correct

16.Variable
Mark for Review
values
(1) Points
can be
changed
as often
as you
like.
True or
false?

True (*)

False

Correct
17. Define the value of the variable LapCount based on the following
Mark for Review
math calculation: LapCount + 10 = 15
(1) Points

10

15

5 (*)

Correct

18. In Alice, there is no way of reordering the function list in the


Mark for Review
function tab. True or false?
(1) Points

True

False (*)

Incorrect. Refer to Section 2 Lesson 7.

19. In Alice, where are objects added and positioned in the scene?
Mark for Review
(1) Points

The template

The Code editor

The Scene editor (*)

The gallery

Incorrect. Refer to Section 2 Lesson 1.


20. In Alice, new procedures are declared in the Scene editor. True or
Mark for Review
false?
(1) Points

True

False (*)

Incorrect. Refer to Section 2 Lesson 5.

21.From your
Mark for Review
Alice lessons,
(1) Points
which of the
following are
types of
storyboards?

(Choose all correct answers)

Actual

Visual (*)

Textual (*)

Factual

Fictional

Incorrect. Refer to Section 2 Lesson


5.

22. In Alice, if only objects that walk on four legs need to use a
Mark for Review
procedure, in which superclass would the procedure be
(1) Points
declared?

Biped

Prop

Quadruped (*)
Swimmer

Correct

23. In Alice, which of the following programming statements


Mark for Review
moves the alien backward the distance to the asteroid, minus
(1) Points
2 meters?

this.Asteroid move backward {this.Alien getDistanceTo


this.Asteorid / 2}

this.Alien move backward {this.Alien getDistanceTo


this.Asteroid -2} (*)

this.Alien move backward {this.Alien getDistanceTo


this.Asteroid * 2}

this.Alien move forward {this.Asteroid getDistanceTo


this.Alien / 2}

Correct

24. In Alice, we can avoid object collision using what?


Mark for Review
(1) Points

Slowing movements down.

Downloading the Alice 3 collision detector app.

Using object detection.

Using math operators. (*)

Correct

Section 3
(Answer all questions in this section)

25. Use your Greenfoot knowledge to answer the question:


Mark for Review
Where are defined variables typically entered in a class's
(1) Points
source code?

In the defined method in the source code.

After the constructors and methods in the source code.

At the top of the source code, before the constructors


and methods. (*)

Between the constructors and methods in the source


code.

Incorrect. Refer to Section 3 Lesson


8.

26.Using the
Mark for Review
Greenfoot
(1) Points
IDE, when is a
constructor
automatically
executed?

When a new image is added to the class.

When the act method is executed.

When a new instance of the class is created. (*)

When source code is written.

Incorrect. Refer to Section 3 Lesson


8.

27. In Greenfoot, actor constructors can be used to create images


Mark for Review
or values and assign them to the variables. True or false?
(1) Points
True (*)

False

Correct

28. The Greenfoot method getRandomNumber is used to create


Mark for Review
predictable behaviour in your scenario
(1) Points

True

False (*)

Incorrect. Refer to Section 3 Lesson


5.

29. The list below displays characteristics of a Greenfoot world


Mark for Review
constructor, except for one. Which one should be removed?
(1) Points

Defines the instance's size and resolution.

Has no return type.

Has a void return type. (*)

Executed automatically when a new instance of the class


is created.

Has the same name as the name of the class.

Correct

30. Which of the following comparison operators represents


Mark for Review
"greater than or equal"?
(1) Points

!=
==

>= (*)

>

Correct

31.In
Mark for Review
Greenfoot,
(1) Points
a
semicolon
is not
necessary
at the end
of a
method
that uses
dot
notation.
True or
false?

True

False (*)

Incorrect. Refer to Section 3 Lesson 5.

32. From your Greenfoot lessons, abstraction techniques can only


Mark for Review
be used once in a class's source code. True or false?
(1) Points

True

False (*)

Incorrect. Refer to Section 3 Lesson 9.


33. In Greenfoot, a way to have all subclasses of a superclass inherit
Mark for Review
a method is by adding the method to the superclass. True or
(1) Points
false?

True (*)

False

Correct

34. Defined methods are methods that are only created by the
Mark for Review
Greenfoot development team?
(1) Points

True

False (*)

Incorrect. Refer to Section 3 Lesson 6.

35. In the following Greenfoot array, what statement would you


Mark for Review
write to access the "a" key?
(1) Points
Keynames = {"a", "b", "c", "d"};

keynames[0] (*)

keynames["a"]

keynames["a" key]

keynames[2]

Incorrect. Refer to Section 3 Lesson 10.

36.From your
Mark for Review
Greenfoot
(1) Points
lessons,
which of
the
following
logic
operators
represents
"and"?

&

&& (*)

Incorrect. Refer to Section 3 Lesson 10.

37. From your Greenfoot lessons, which symbol represents string


Mark for Review
concatenation?
(1) Points

Symbol <

Symbol =

Symbol &

Symbol + (*)

Incorrect. Refer to Section 3 Lesson 10.

38. In Greenfoot, which statement is a correct example of string


Mark for Review
concatenation?
(1) Points

bee.setImage("bee" - "I" - ".png");

Bee bee = new Bee(image1);

bee.setImage("bee.png");

bee.setImage("bee" + i + ".png"); (*)


Incorrect. Refer to Section 3 Lesson 10.

39. Which of the following type of audience should you ask to play
Mark for Review
your Greenfoot game during the testing phase?
(1) Points

Programmer

Target (*)

Testing

Primary

Incorrect. Refer to Section 3 Lesson 4.

40. From your Greenfoot lessons, Which of the following statements


Mark for Review
is most correct?
(1) Points

My program is complete when I add music to it.

My program is complete when it compiles.

My program is complete when it runs and I've tested the


code. (*)

My program is complete when I add images to it.

Incorrect. Refer to Section 3 Lesson 4.

41.In
Mark for Review
Greenfoot,
(1) Points
which of
the
following
methods
return the
world that
the
instance
lives in?

getXY()

World getWorld() (*)

getRotation()

World getClass()

Correct

42. From your Greenfoot lessons, where do you review a class's


Mark for Review
inherited methods?
(1) Points

Documentation (*)

Act method

Inspector

If-statement

Correct

43. Which of the following demonstrates a Greenfoot


Mark for Review
subclass/superclass relationship?
(1) Points

A single person is a superclass of the human subclass.

A computer is a subclass of a video game superclass.

A dog is a subclass of the cat superclass.

A rose is a subclass of the flower superclass. (*)

Correct
44. From your Greenfoot lessons, the reset button resets the
Mark for Review
scenario back to its initial position. True or false?
(1) Points

True (*)

False

Correct

45. In Greenfoot what command would you use to detect if a mouse


Mark for Review
has been clicked on an actor?
(1) Points

Greenfoot.pressed(this)

Greenfoot.mouseClicked(this) (*)

Actor.clicked(this)

Greenfoot.clicked(this)

Incorrect. Refer to Section 3 Lesson 7.

46.What type
Mark for Review
of
(1) Points
parameter
does the
Greenfoot
playSound
method
expect?

name of a keyboard key (as String)

name of an integer (as int)

name of a sound file (as String) (*)


name of the class (as String)

Incorrect. Refer to Section 3 Lesson 7.

47. An instance variable can be saved and accessed later, even if the
Mark for Review
instance no longer exists. True or false?
(1) Points

True

False (*)

Correct

48. In Greenfoot, the move method expects what type of


Mark for Review
information in its parameters?
(1) Points

Integer of steps to move forward (*)

True or false response

String statement

Degrees to turn

Correct

49. In Greenfoot, the turn method expects what type of information


Mark for Review
in its parameters?
(1) Points

Parameter void

Degrees to turn (*)

Integer of steps to move forward

String statement
True or false response

Correct

50. In Greenfoot, the body of the method is located in between


Mark for Review
which of the following characters?
(1) Points

Asterisks **

Square brackets [ ]

Parnetheses ( )

Curly brackets { } (*)

Correct

You might also like