test mgj final 2 86%

25
1. From your Alice lessons, built-in functions provide precise property details for the following areas: Mark for Review (1) Points Proximity and size. Distance to and nesting. Proximity, size, spatial relation, and point of view. (*) Proximity and point of view. Correct 2. Alice objects move relative to the orientation of the person viewing the animation. True False (*) Incorrect. Refer to Section 2 Lesso 3. Which of the following does not describe variables? A place in memory where data of a specific type can be stored for later retriev

Upload: miljanjeremic

Post on 10-Jul-2016

200 views

Category:

Documents


9 download

DESCRIPTION

Java Fundamentals Exam 2

TRANSCRIPT

Page 1: TEST MGJ FINAL 2 86%

1. From your Alice lessons, built-in functions provide precise property details for the following areas:

Mark for Review (1) Points

Proximity and size.Distance to and nesting.Proximity, size, spatial relation, and point of view. (*)Proximity and point of view.

Correct

2. Alice objects move relative to the orientation of the person viewing the animation. True or false?

TrueFalse (*)

Incorrect. Refer to Section 2 Lesson 2.

3. Which of the following does not describe variables?

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

Page 2: TEST MGJ FINAL 2 86%

Correct

4. Which of the following is not a relational operator?

<// (*)>=

Correct

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

Slowing movements down.Using math operators. (*)Downloading the Alice 3 collision detector app.Using object detection.

Correct 6. Identify an example of an Alice

expression. Mark for Review (1) Points

"I feel happy."If or Where3x3=9 (*)

Page 3: TEST MGJ FINAL 2 86%

None of the above

Correct

7. An Alice event is considered what?

A party with at least 20 people.An object's orientation.Error handling.A keystroke or mouse click. (*)

Correct

8. In Alice, you can define your own procedures for a class, but not your own functions. True or false?

TrueFalse (*)

Correct

9. From your Alice lessons, the "Checklist for Animation Completion" does not ask questions about the scenario and storyboards, because these are not valid parts of the animation creation process. True or false?

TrueFalse (*)

Page 4: TEST MGJ FINAL 2 86%

Correct

10. 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. 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 detailed steps for the science concept. 2. Present the problem as an animation.1. Present the problem as an animation.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. (*)

Correct 11. Which of the following IF control

structures command the blue tang fish to roll and simultaneously move down if it collides with a shark, or move forward if it does not collide with a shark?

Mark for Review (1) Points

Page 5: TEST MGJ FINAL 2 86%

(*)

Page 6: TEST MGJ FINAL 2 86%

Correct

12. In Alice, the setVehicle procedure will associate one object to another. True or false?

True (*)False

Page 7: TEST MGJ FINAL 2 86%

Correct

13. Which of the following actions would require a control statement to control animation timing?

(Choose all correct answers)

A biped object walking. (*)A rock object turning.A fish swimming. (*)A bird flying. (*)

Correct

14. In Alice, a computer program requires functions to tell it how to perform the procedure. True or false?

TrueFalse (*)

Correct

15. A complete Alice instruction includes which of the following components?

(Choose all correct answers)

Image

Page 8: TEST MGJ FINAL 2 86%

ClassProcedure (*)Direction (*)Amount (*)

Correct 16. From your Alice lessons,

which of the following are types of storyboards?

Mark for Review (1) Points

(Choose all correct answers)

ActualTextual (*)FactualVisual (*)Fictional

Correct

17. In Alice, you examine code where a bird moves its wings forward and backward while moving forward simultaneously across the scene. You notice that this set of procedures are repeated in the Code editor ten times to achieve this motion. How could procedural abstraction be used to make the code simpler and easier to read?

(Choose all correct answers)

Do not make any changes to the code.Use the Count control statement to execute the forward motion of the body and up and down motion of the wings 10 times. (*)

Page 9: TEST MGJ FINAL 2 86%

Use the Scene editor to position the wings so that they are up as the body moves forward.Declare a separate "fly" procedure for the body moving forward and wings moving up and down. (*)

Incorrect. Refer to Section 2 Lesson 5.

18. In Alice, when a new procedure is declared, all subclasses of the superclass will inherit the procedure. True or false?

True (*)False

Correct

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

ColorDecimal NumberWhole NumberFunction (*)

Correct

20. 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

Page 10: TEST MGJ FINAL 2 86%

Correct 21. Which of the following statements about what happens when the following code is executed is false? Mark for Review

(1) Points

The message "Printing Some Text" will be printed until loopVal is no longer less than 5.The variable loopVal is initialized to 0.The condition loopVal < 5 is tested after the block is executed. (*)The condition loopVal < 5 returns a boolean value.None of the above.

22. Which of the following does not describe methods?

A subprogram that acts on data and often returns a value.

Page 11: TEST MGJ FINAL 2 86%

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

Section 3(Answer all questions in this section)

23. From your Greenfoot lessons, abstraction techniques can only be used once in a class's source code. True or false?

TrueFalse (*)

24. From your Greenfoot lessons, what is a loop?

A statement that executes one segment of code.A statement that can execute a section of code multiple times. (*)A statement that can execute a section of code one time.A statement that can execute a method multiple

Page 12: TEST MGJ FINAL 2 86%

times.

25.From your Greenfoot lessons, which symbol represents string concatenation?

Symbol &Symbol <Symbol =Symbol + (*)

26. In Greenfoot, what type of symbol is used to connect boolean expressions?

Mark for Review (1) Points

String concatenationLogic operators (*)IntegersKeyboard key names

Correct

27. In Greenfoot, what is a common letter used for the loop variable? Mark for Review (1) Points

Page 13: TEST MGJ FINAL 2 86%

AI (*)XY

Correct

28. From your Greenfoot lessons, to create a new instance of the Duke class, you right-click on the class, then select which of the following commands in the class menu? Mark for Review 

(1) Points

New subclass...Set image...new Duke() (*)InspectRemove

Correct

29. Which of the following demonstrates a Greenfoot subclass/superclass relationship? Mark for Review (1) Points

A dog is a subclass of the cat superclass.A rose is a subclass of the flower superclass. (*)A computer is a subclass of a video game superclass.A single person is a superclass of the human subclass.

Correct

Page 14: TEST MGJ FINAL 2 86%

30. From your Greenfoot lessons, if the condition in an if-statement is true, the first code segment is executed. True or false? Mark for Review 

(1) Points

True (*)False

Correct 31. 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

TrueFalse (*)

Incorrect. Refer to Section 3 Lesson 3.

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

When source code is written.When a new image is added to the class.When a new instance of the class is created. (*)

Page 15: TEST MGJ FINAL 2 86%

When the act method is executed.

Correct

33. Specific to the Greenfoot IDE, which of the following stop methods is written correctly? Mark for Review 

(1) Points

stop.Greenfoot( );Greenfoot(stop);Greenfoot.stop( ); (*)Greenfoot.stop(key);

Correct

34. In Greenfoot, we can use the act method in the class to automatically create the Actor instances when the world is initialized. True or false? Mark for Review 

(1) Points

TrueFalse (*)

Incorrect. Refer to Section 3 Lesson 8.

35. From your Greenfoot lessons, which of the following is an example of a type of data passed through a parameter? Mark for Review 

(1) Points

MethodsClassesIntegers (*)

Page 16: TEST MGJ FINAL 2 86%

Scenarios

Correct 36. What type of

Greenfoot method would be used to turn an object?

Mark for Review (1) Points

orientTo( );turnAround( );move ( );turn( ); (*)

Correct

37. From the Greenfoot IDE, where are inherited methods located? Mark for Review (1) Points

In the computer networkIn the Greenfoot image galleryIn the Scene editorIn the documentation (*)

Correct

38. In the Greenfoot IDE, which of the following are components of a parameter? Mark for Review (1) Points

Page 17: TEST MGJ FINAL 2 86%

(Choose all correct answers)

Parameter type (*)Parameter returnParameter name (*)Parameter methodParameter void

Correct

39. 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

Correct

40. From your Greenfoot lessons, to save space in the act method, you can write an entirely new method below it, called a _____________. Mark for Review 

(1) Points

Class methodInstance methodDefined method (*)World methodCode method

Correct

Page 18: TEST MGJ FINAL 2 86%

41. From your Greenfoot lessons, which of the following is an example of changing the environment during a Q/A test cycle?

Mark for Review (1) Points

Use a different operating system. (*)Use the mouse instead of the keyboard.Use symbols instead of numbers.All of the above.

Incorrect. Refer to Section 3 Lesson 12.

42. In Greenfoot, in which programming task are the objects identified? Mark for Review (1) Points

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

Correct

43. Use your Greenfoot knowledge: A specification of a method is called a __________________. Mark for Review 

(1) Points

Page 19: TEST MGJ FINAL 2 86%

SubclassClassSignature (*)Parameter

Correct

44. In Greenfoot, which method checks if a key on the keyboard has been pressed? Mark for Review (1) Points

keyPress methodkeyUp methodkeyDown method (*)keyClick method

Incorrect. Refer to Section 3 Lesson 7.

45. When designing a game in Greenfoot, it helps to define the actions that will take place in a textual storyboard. True or false? Mark for Review 

(1) Points

True (*)False

Correct 46. Using the Greenfoot

IDE, which of the following

Mark for Review (1) Points

Page 20: TEST MGJ FINAL 2 86%

programming statements tells the object to turn 38 degrees?

move():move(2);turn(38); (*)turn(38):

Correct

47. In Greenfoot, you can use comparison operators to compare a variable to a random number. True or false? Mark for Review 

(1) Points

True (*)False

Correct

48. Use you Greenfoot knowledge: What range of numbers does the following method return?

Greenfoot.getRandomNumber(30)

Mark for Review (1) Points

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.

Page 21: TEST MGJ FINAL 2 86%

Correct

49. In a Greenfoot if-else statement, if the condition is true, the if-statement is executed, and then the else-statement is executed. True or false? Mark for Review 

(1) Points

TrueFalse (*)

Correct

50. From your Greenfoot lessons, which of the following is not a characteristic of a static method? Mark for Review 

(1) Points

Belongs to a class itselfBelongs to an instance itself (*)Available for other classes to use with dot notationSignature contains the word staticIs a method

Correct