Sie sind auf Seite 1von 45

Test: Java Fundamentals Midterm Exam

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Top of Form
Section 2
(Answer all questions in this section)

1.

Which of the following does not describe methods?

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. (*)

Incorrect. Refer to Section 2 Lesson 14.

2.

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.

Incorrect. Refer to Section 2 Lesson 14.

3.

From your Alice lessons, which of the following are types of storyboards?

(Choose all correct answers)

Actual
Textual (*)

Factual
Visual (*)
Fictional

Incorrect. Refer to Section 2 Lesson 5.

4.

In Alice, which of the following is the most likely situation where procedural abstraction could be used?

Five dogs all need to bark and run at the same time. (*)
One fish needs to swim forward 1 meter.
Two fish say something to each other.
One person moves up 10 meters.

Incorrect. Refer to Section 2 Lesson 5.

5.

In Alice, procedural abstraction is the concept of making code easier to understand and reuse. True or fals

True (*)
False

Incorrect. Refer to Section 2 Lesson 5.

Test: Java Fundamentals Midterm Exam

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Top of Form
Section 2
(Answer all questions in this section)

6.

Which of the following does not describe variables?

Mark for Review


(1) Points

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. (*)

Incorrect. Refer to Section 2 Lesson 13.

7.

Which of the following is not a relational operator?

Mark for Review


(1) Points

<
// (*)
>
=

Incorrect. Refer to Section 2 Lesson 13.

8.

In Alice, the procedures' arguments allow the programmer to adjust the


object, motion, distance amount, and time duration. True or false?

Mark for Review


(1) Points

True (*)

False

Correct

9.

In Alice, the setVehicle procedure will associate one object to another.


True or false?

Mark for Review


(1) Points

True (*)
False

Incorrect. Refer to Section 2 Lesson 6.

10. In Alice, a computer program requires functions to tell it how to perform


the procedure. True or false?

Mark for Review


(1) Points

True

False (*)

Incorrect. Refer to Section 2 Lesson 6.

Test: Java Fundamentals Midterm Exam

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Top of Form
Section 2
(Answer all questions in this section)

11.

All objects in Alice have three dimensional coordinates on which axes?

(Choose all correct answers)

x (*)
y (*)
z (*)
w
All of the above

Incorrect. Refer to Section 2 Lesson 2.

12.

What is the first step to programming an object to turn left in Alice?

Select the duration for the object to turn.

Select the distance to turn.


Select the object to program from the instance menu. (*)
Drag the turn procedure into the Code editor.

Incorrect. Refer to Section 2 Lesson 3.

13.

Functions answer questions about an object, such as its height, width, depth and even distance to another

True (*)
False

Correct

14.

A complete Alice instruction includes which of the following components?

(Choose all correct answers)

Image
Class
Procedure (*)
Direction (*)
Amount (*)

Incorrect. Refer to Section 2 Lesson 4.

15.

What should you refer to for the animation's design specifications as you program your Alice animation?

Code
Scene editor
Storyboard (*)
Scenario

Correct

Test: Java Fundamentals Midterm Exam

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Top of Form

Section 2
(Answer all questions in this section)

16.

From your Alice lessons, when testing your animation, you should test that comments were added below e

True
False (*)

Incorrect. Refer to Section 2 Lesson 12.

17.

Which of the following IF control structures command the blue tang fish to roll and simultaneously move d

(*)

Incorrect. Refer to Section 2 Lesson 8.

18.

Which of the following is not an Alice variable value type?

Color
Decimal Number
Whole Number
Function (*)

Incorrect. Refer to Section 2 Lesson 10.

19.

Which of the following programming instructions commands the fish to continuously move forward a rand

(*)

Correct

20.

Alice uses built-in math operators; they are:

Add and subtract


Multiply and divide
All of the above (*)
None of the above

Correct

Test: Java Fundamentals Midterm Exam

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Top of Form
Section 2
(Answer all questions in this section)

21.

In Alice, which of the following programming statements moves the cat backward, half the distance to the

this.Cat move backward {this.Bird getDistanceTo this.Cat / 2}


this.Cat move forward {this.Bird getDistanceTo this.Cat / 2}
this.Bird move forward {this.Bird getDistanceTo this.Cat / 2}
this.Cat move backward {this.Cat getDistanceTo this.Bird / 2} (*)

Incorrect. Refer to Section 2 Lesson 9.

22.

An Alice event is considered what?

A party with at least 20 people.


An object's orientation.
Error handling.
A keystroke or mouse click. (*)

Incorrect. Refer to Section 2 Lesson 11.

Section 3

(Answer all questions in this section)

23.

Using the Greenfoot IDE, when is a constructor automatically executed?

When source code is written.


When a new image is added to the class.
When a new instance of the class is created. (*)
When the act method is executed.

Incorrect. Refer to Section 3 Lesson 8.

24.

Using Greenfoot, how do we change the size and resolution of the World instance?

Edit the methods in the class.


Edit the values in the constructor. (*)
Delete the instance.
Edit the values in the class's act method.

Correct

25.

In Greenfoot, an if-statement is used to alternate between displaying two images in an instance. True or fa

True
False (*)

Incorrect. Refer to Section 3 Lesson 8.

Test: Java Fundamentals Midterm Exam

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Top of Form
Section 3
(Answer all questions in this section)

26.

In the Greenfoot IDE, which of the following are components of a parameter?

(Choose all correct answers)

Parameter type (*)


Parameter return
Parameter name (*)
Parameter method
Parameter void

Incorrect. Refer to Section 3 Lesson 2.

27.

From your Greenfoot lessons, to view the methods that a class inherits, open the code editor and select do

True (*)
False

Incorrect. Refer to Section 3 Lesson 2.

28.

From your Greenfoot lessons, instances do not have any memory. True or false?

True
False (*)

Incorrect. Refer to Section 3 Lesson 2.

29.

What type of Greenfoot method would be used to turn an object?

orientTo( );
turnAround( );

move ( );
turn( ); (*)

Incorrect. Refer to Section 3 Lesson 2.

30.

From your Greenfoot lessons, a problem statement defines the purpose for your game. True or false?

True (*)
False

Correct

Test: Java Fundamentals Midterm Exam

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Top of Form
Section 3
(Answer all questions in this section)

31.

Which of the following type of audience should you ask to play your Greenfoot game during the testing ph

Testing
Target (*)
Primary
Programmer

Correct

32.

Use you Greenfoot knowledge: What range of numbers does the following method return?
Greenfoot.getRandomNumber(30)

A random number between 1 and 30.


A random number between 0 and 30.
A random number between 0 and 29. (*)
A random number between 1 and 29.

Incorrect. Refer to Section 3 Lesson 5.

33.

From your Greenfoot lessons, which of the following is not a characteristic of a static method?

Belongs to a class itself


Belongs to an instance itself (*)
Available for other classes to use with dot notation
Signature contains the word static
Is a method

Incorrect. Refer to Section 3 Lesson 5.

34.

When a Greenfoot code segment is executed in an if-statement, each line of code is executed in sequentia

True (*)
False

Incorrect. Refer to Section 3 Lesson 5.

35.

From your Greenfoot lessons, a comparison operator returns what value when a number meets its requirem

0
VOID
1 (*)
NULL

Incorrect. Refer to Section 3 Lesson 5.

Test: Java Fundamentals Midterm Exam

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Top of Form
Section 3
(Answer all questions in this section)

36.

From your Greenfoot lessons, the keyDown method is located in which class?

Actor
Greenfoot (*)
GreenfootImage
World

Correct

37.

In Greenfoot, only 10 methods can be written for each class in the Code editor. True or false?

True
False (*)

Incorrect. Refer to Section 3 Lesson 3.

38.

From your Greenfoot lessons, in an if-statement, the programming statements written in curly brackets are

True
False (*)

Correct

39.

In Greenfoot, defined methods must be used immediately. True or false?

True
False (*)

Incorrect. Refer to Section 3 Lesson 6.

40.

From your Greenfoot lessons, how do you call a defined method?

Call the method from the act method. (*)


Call the method from the defined method.

Write the method in the World superclass.


Write the method in the instance.
Write the method in the source code.

Incorrect. Refer to Section 3 Lesson 6.

Test: Java Fundamentals Midterm Exam

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Top of Form
Section 3
(Answer all questions in this section)

41.

In Greenfoot, in which programming task are the objects identified?

Define the problem.


Design the solution.
Program the solution. (*)
Test the solution.

Correct

42.

From your Greenfoot lessons, which of the following are examples of Q/A test variations?

Change the environment.

Change the execution.


Change the data.
All of the above. (*)

Incorrect. Refer to Section 3 Lesson 12.

43.

In Greenfoot, the image below is an example of what construct?

Method
Conditional (*)

Variable Assignment
Class

Incorrect. Refer to Section 3 Lesson 12.

44.

From your Greenfoot lessons, the reset button resets the scenario back to its initial position. True or false?

True (*)
False

Correct

45.

Which of the following Java syntax is used to correctly create a Duke subclass?

private Dog extends World


public class Dog extends World
public class Duke extends Animal (*)
private class extends Actor
private class extends Duke

Incorrect. Refer to Section 3 Lesson 1.

Test: Java Fundamentals Midterm Exam

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Top of Form
Section 3
(Answer all questions in this section)

46.

Use your Greenfoot knowldege: Abstraction occurs in many different ways in programming. True or false?

True (*)
False

Incorrect. Refer to Section 3 Lesson 9.

47.

From your Greenfoot lessons, which of the following logic operators represents "and"?

&
&& (*)
=
!

Incorrect. Refer to Section 3 Lesson 10.

48.

In Greenfoot, what happens if the end to a while loop isn't established?

The code will keep executing and will never stop. (*)
The code will execute once and then stop, due to controls in Greenfoot.
The code will prompt you to enter a loop counter.
The code will not execute.

Correct

49.

In the Greenfoot IDE, what symbols indicate that the variable is an array?

Square brackets [ ] (*)


Curly brackets { }
Semicolon ;
Colon :

Incorrect. Refer to Section 3 Lesson 10.

50.

In Greenfoot, which of the following statements could prevent an infinite loop from occurring?

I = 100 + i
i=1
i=i
i = i + 1 (*)

Incorrect. Refer to Section 3 Lesson 10.

Page 10 of 10
Bottom of Form

Das könnte Ihnen auch gefallen