1. what is one goal that object-oriented programming helps ...€¦ · 1. what is one goal that...

Post on 13-Jul-2020

4 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1. What is one goal that object-oriented programming helps the user achieve?

a. All Alice worlds revolve around objects, thus the objects are visible. b. It helps organize large programs by breaking down the coding into small manageable pieces. c. It allows all programming to be included in one long block of code, so that when a problem arises, the programmer needs to only look in one place. d. It allows the Alice camera to always be orient to the action ongoing in the Alice world.

Answer: _____ 2. Object-oriented programming uses ____________ as basic program components.

a. only classes b. only classes and objects c. only classes and methods d. classes, objects, and methods

Answer: _____ 3. What does a class define?

a. a particular kind of object b. the folder from which an Alice object is found c. the types of "blocks" dragged into Alice code, such as "Do together" and "loop" d. the properties of the world, such as where the camera is facing

Answer: _____ 4. It is conventional for the names of classes to begin with a capital letter.

a. True b. False

Answer: _____ 5. How are classes predefined in Alice?

a. as different ground textures available when a new world is created b. as the "center" of an Alice object c. as 3D models provided in the gallery

d. as the different built-in abilities objects have, such moving and turning

Answer: _____ 6. The action of creating and displaying an object from a class is known as _____________.

a. instantiating the class b. encapsulating the class c. calling the class d. inheriting the class

Answer: _____ 7. It is conventional for the names of objects to begin with a capital letter.

a. True b. False

Answer: _____ 8. All objects of the same class share some commonality.

a. True b. False

Answer: _____ 9. Two objects are instantiated from the same class. The properties of these objects are identical. These two objects are not unique.

a. True b. False

Answer: _____ 10. What is a method?

a. an object instantiated from a class b. an elegant and efficient way of programming c. a coordinated sequence of instructions that will be carried out when requested d. using Alice control structures such as a "Loop" to shorten code

Answer: _____

11. Every object in an Alice world has a repertoire of instructions it knows how to do--move, turn, turn to face, etc. These instructions are actually ____________ methods, built-in to the Alice software.

a. objective b. secondary c. evolutionary d. primitive

Answer: _____ 12. Although primitive methods are built-in to Alice objects, these primitive methods cannot be used in methods defined by the programmer.

a. True b. False

Answer: _____ 13. One purpose of methods is to _____________.

a. divide a program into small manageable pieces that work together to create a meaningful whole b. allow two different objects to be instantiated from the same class c. allow non-interactive code to execute differently each time an Alice world is run d. create a distinction between built-in Alice objects and modified Alice objects

Answer: _____ 14. The concept of thinking about an overall task instead of focusing on all the small actions needed to complete the task is known as ____________.

a. refinement b. abstraction c. instantiating d. class creation

Answer: _____ 15. The authors of the Alice text describe a parameter as _____________.

a. acting like a basket to receive information that is sent to a method

b. is the list of object properties that can be changed to make objects of the same class different c. the focal point of object-oriented programming d. acting like a boomerang that returns information from a method

Answer: _____ 16. Methods that specifically reference more than one object are typically written as world-level methods in Alice.

a. True b. False

Answer: _____ 17. Methods that define behaviors for a single object are typically written as class-level methods in Alice.

a. True b. False

Answer: _____ 18. The action of requesting that Alice execute the instructions in a method is known as the process of __________.

a. instantiating a method b. calling a method c. refining a method d. abstracting a method

Answer: _____ 19. The design technique of breaking the overall task down into abstract tasks and then breaking each task down into smaller pieces and then defining the steps in each piece is known as ____________.

a. sequential processing b. repeating behavior c. conditional execution d. stepwise refinement

Answer: _____ 20. In Alice, the type of information that can be sent to a method's parameter include which of the following?

a. a numeric value b. a numeric value or an object

c. a numeric value, an object, or a color d. all of the above and more

Answer: _____ 21. One benefit of using class-level methods is ____________.

a. the use of parameters to return a value b. the ability to inherit, once the method is written c. the allowance of object instantiation d. that class-level methods from objects of a different class may be called

Answer: _____ 22. Calling world-level methods should from within a class-level method generally is not good programming practice.

a. True b. False

Answer: _____ 23. Since class-level methods deal with objects themselves, it is acceptable to use instructions for all types of objects in a class-level method.

a. True b. False

Answer: _____ 24. As opacity is decreased, an object becomes less distinct, and more difficult to see.

a. True b. False

Answer: _____ 25. There is no functionality of the opacity property which cannot be achieved using only the isShowing property.

a. True b. False

Answer: _____

26. Setting the isShowing property to false or the opacity property to 0 will delete an object from an Alice world.

a. True b. False

Answer: _____ 27. Sometimes an Alice programmer needs to set up a stationary reference point for other objects. What tip is given by the text authors for such purpose?

a. always use the origin of the world as the reference point b. use parameters to remember the distance from the reference point c. always use class-level methods so that references are in respect to each object's orientation d. use an invisible object as the reference point

Answer: _____ 28. Since objects can be passed to a method via parameters, it is perfectly acceptable to pass a sound file to a method via parameters.

a. True b. False

Answer: _____ 29. The following Alice world contains a guy on the beach, named randomGuy2, a beach ball, a beach chair, and a frisbee. randomGuy2 is facing the beach chair. A class-level method, kick, was created and is shown. The beach ball and beach chair are 4 meters apart. How many times will the "kick" method be called?

a. 0 times - kick will never get called b. once c. twice d. three times e. unknown number of times because the orientation of the beach ball is unknown

Answer: _____ 30. The following Alice world contains a guy on the beach, randomGuy2, a beach ball, a beach chair, and a frisbee. randomGuy2 is facing the beach chair. A class-level method, kick, was created and is shown. The beach ball and beach chair are 4 meters apart. How many times will the "kick" method be called?

a. 0 times - kick will never get called b. once c. twice d. three times e. unknown number of times because the orientation of the beach ball is unknown

Answer: _____ 31. The following Alice world contains a guy on the beach, randomGuy2, a beach ball, a beach chair, and a frisbee. randomGuy2 is facing the beach chair. A class-level method, kick, was created and is shown. The beach ball and beach chair are 4 meters apart. The beach ball's forward orientation is away from the beach chair. Bob is initially 6 meters away from the beach ball. How far will the beach ball travel after the method kick is called twice?

a. 1 meter b. 6 meters c. 10 meters d. 11 meters e. the method kick is not called twice

Answer: _____ 32. The following Alice world contains a guy on the beach, randomGuy2, a beach ball, a beach chair, and a frisbee. randomGuy2 is facing the beach chair. A class-level method, kick, was created and is shown. randomGuy2 is attempting to kick the frisbee to the beach chair. The frisbee's forward orientation is towards the beach chair. randomGuy2 is 4 meters from the frisbee and 3 meters from the beach ball. The frisbee is 6 meters from the beach chair. Assuming randomGuy2 only wants to kick the frisbee to the beach chair, and nothing else, how far will randomGuy2 move when the below program is run?

a. 3 meters b. 4 meters c. 6 meters d. 10 meters

Answer: _____ 33. The following Alice world contains a guy on the beach, randomGuy2 a beach ball, a beach chair, and a frisbee. randomGuy2 is facing the beach chair. A class-level method, kick, was created and is shown. randomGuy2 is attempting to kick the frisbee to the beach chair. The frisbee's forward orientation is towards the beach chair. randomGuy2 is 4 meters from the frisbee and 3 meters from the beach ball. The frisbee is 6 meters from the beach chair. Assuming randomGuy2 only wants to kick the frisbee to the beach chair, and nothing else, how far will randomGuy2 move when the below program is run?

a. 3 meters b. 4 meters c. 6 meters d. 10 meters

Answer: _____ 34. The following Alice world contains a guy on the beach, randomGuy2, a beach ball, a beach chair, and a frisbee. randomGuy2 is facing the beach chair. A class-level method, kick, was created and is shown. randomGuy2 is attempting to kick the frisbee to the beach chair. The frisbee's forward orientation is towards the beach chair. randomGuy2 is 4 meters from the frisbee and 3 meters from the beach ball. The frisbee is 6 meters from the beach chair. Assuming randomGuy2 only wants to kick the frisbee to the beach chair, and nothing else, how far will randomGuy2 move when the below program is run?

a. 3 meters b. 4 meters c. 6 meters d. 10 meters

Answer: _____ 35. The following Alice world contains a guy on the beach, randomGuy2, a beach ball, a beach chair, and a frisbee. randomGuy2 is facing the beach chair. A class-level method, kick, was created and is shown. randomGuy2 is attempting to kick the frisbee to the beach chair. The frisbee's forward orientation is towards the beach chair. randomGuy2 is 4 meters from the frisbee and 3 meters from the beach ball. The frisbee is 6 meters from the beach chair. How many times will the method kick be called?

a. never b. once c. twice d. three times

Answer: _____ 36. The following Alice world contains a guy on the beach, randomGuy2, a beach ball, a beach chair, and a frisbee. randomGuy2 is facing the beach chair. A class-level method, kick, was created and is shown. randomGuy2 is attempting to kick the frisbee to the beach chair. The frisbee's forward orientation is towards the beach chair. randomGuy2 is 4 meters from the frisbee and 3 meters from the beach ball. The beach ball is 4 meters from the beach chair. The frisbee is 6 meters from the beach chair. How far will the frisbee be kicked?

a. 0 meters - nowhere b. 4 meters c. 6 meters d. 10 meters

Answer: _____ 37. The following Alice world contains a guy on the beach, randomGuy2, a beach ball, a beach chair, and a frisbee. randomGuy2 is facing the beach chair. A class-level method, kick, was created and is shown. randomGuy2 is attempting to kick the frisbee to the beach chair. The frisbee's forward orientation is towards the beach chair. Bob is 4 meters from the frisbee and 3 meters from the beach ball. The beach ball is 4 meters from the beach chair. The frisbee is 6 meters from the beach chair. How far will the beach ball be kicked?

a. 0 meters - nowhere b. 4 meters c. 6 meters d. 10 meters

Answer: _____

38. The following Alice world contains a guy on the beach, randomGuy2, a beach ball, a beach chair, and a frisbee. randomGuy2 is facing the beach chair. A class-level method, kick, was created and is shown. randomGuy2 is attempting to kick the frisbee to the beach chair. The frisbee's forward orientation is towards the beach chair. randomGuy2 is 4 meters from the frisbee and 3 meters from the beach ball. The beach ball is 4 meters from the beach chair. The frisbee is 6 meters from the beach chair. Is it true that both the beach ball and the frisbee are by the beach chair after the code is finished running?

a. True b. False

Answer: _____ 39. A rabbit, horse, penguin, and tortoise are lined up in a straight line in the below Alice world. Consider these as four positions, where the rabbit is occupying position 0, the horse is occupying position 1, and so on. After the following code is run, what position will the rabbit be occupying?

a. position 0 b. position 1 c. position 2 d. position 3

Answer: _____ 40. A rabbit, horse, penguin, and tortoise are lined up in a straight line in the below Alice world. Consider these as four positions, where the rabbit is occupying position 0, the horse is occupying position 1, and so on. Each position is separated by one meter. How far will the rabbit be from the penguin after this code is run?

a. 0 meters b. 1 meter c. 2 meters d. 3 meters

Answer: _____ 41. A rabbit, horse, penguin, and tortoise are lined up in a straight line in the below Alice world. Consider these as four positions, where the rabbit is occupying position 0, the horse is occupying position 1, and so on. Each position is separated by one meter. What position will the rabbit occupy after the following code is run?

a. position 0 b. position 1 c. position 2 d. position 3

Answer: _____ 42. A rabbit, horse, penguin, and tortoise are lined up in a straight line in the below Alice world. Consider these as four positions, where the rabbit is occupying position 0, the horse is occupying position 1, and so on. Each position is separated by one meter. How collectively high will the rabbit have jumped (counting only going up) after the code is run?

a. 2 meters b. 3 meters c. 4 meters d. the rabbit doesn't jump

Answer: _____ 43. A rabbit, horse, penguin, and tortoise are lined up in a straight line in the below Alice world. Consider these as four positions, where the rabbit is occupying position 0, the horse is occupying position 1, and so on. Each position is separated by one meter. What positioning of animals (from left to right) will force the rabbit to jump only 2 collective meters (counting only going up) when the program is run?

a. the current configuration b. rabbit, horse, tortoise, penguin c. horse, rabbit, tortoise, penguin d. horse, penguin, rabbit, tortoise

Answer: _____ 44. A rabbit, horse, penguin, and tortoise are lined up in a straight line in the below Alice world. Consider these as four positions, where the rabbit is occupying position 0, the horse is occupying position 1,, and so on. Each position is separated by one meter. What animal(s) will jump when the following program is run?

a. the horse b. the rabbit c. the penguin d. the penguin and the rabbit

Answer: _____ 45. A rabbit, horse, penguin, and tortoise are lined up in a straight line in the below Alice world. Consider these as four positions, where the rabbit is occupying position 0, the horse is occupying position 1, and so on. Each position is separated by one meter. What animal will remain stationary for the entire duration when the world is running?

a. the tortoise b. the rabbit c. the penguin d. none of the animals

Answer: _____ 46. A rabbit, horse, penguin, and tortoise are lined up in a straight line in the below Alice world. Consider these as four positions, where the rabbit is occupying position 0, the horse is occupying position 1,and so on. Each position is separated by one meter. The horse will not be facing the camera after the world is run.

a. True b. False

Answer: _____ 47. A rabbit, horse, penguin, and tortoise are lined up in a straight line in the below Alice world. Consider these as four positions, where the rabbit is occupying position 0, the horse is occupying position 1, and so on. Each position is separated by one meter. What amount of collective distance traveled occurs when the world is run? (count up and down for jumps, turns can be disregarded)

a. 3 meters b. 5 meters c. 6 meters d. 8 meters

Answer: _____ 48. A rabbit, horse, penguin, and tortoise are lined up in a straight line in the below Alice world. Consider these as four positions, where the rabbit is occupying position 0, the horse is occupying position 1,and so on. Each position is separated by one meter. The rabbit will be sitting on top of the horse after the world is run.

a. True b. False

Answer: _____ 49. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. In what direction will the hare be facing after the following code is run?

a. towards the camera b. away from the camera c. the same direction as he started d. opposite the direction as he started

Answer: _____ 50. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. In what direction will the hare be facing

after the following code is run?

a. towards the camera b. away from the camera c. the same direction as he started d. opposite the direction as he started

Answer: _____

51. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. In what direction will the flamingo be facing after the following code is run?

a. towards the camera b. away from the camera c. the same direction as she started d. opposite the direction as she started

Answer: _____

52. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. How close to each other will the hare and flamingo be after the following code is run?

a. 1.5 meters b. 2 meters c. 2.5 meters - the same distance d. 3 meters

Answer: _____

53. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. How many programmer-defined class-level methods are called when the world is run?

a. 2 b. 4 c. 6 d. 7

Answer: _____

54. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. How many programmer-defined world-level methods are called when the world is run?

a. 2 b. 4 c. 6 d. 7

Answer: _____

55. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. Which of the following potential modification would result in the following code running in an infinite loop (never ending)?

a. enclosing the "world.dance" call in "world.my first method" inside a loop which cycles 10000 times b. appending the class-level method "flamingo.jump_turn" with a call to "hare.hop_turn" c. appending the class-level method "flamingo.jump_turn" with a call to "world.dance" d. appending the class-level method "world.dance" with calls to "hare.hop_turn" and "flamingo.jump_turn"

Answer: _____ 56. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. After the following code is run, what is the total, collective number of revolutions that the tortoise and hare spin together?

a. 0.25 revolutions b. 0.5 revolutions c. 0.75 revolutions d. 1.0 revolutions

Answer: _____

57. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. After the following code is run, the flamingo and the hare are either directly facing each other (face-to-face), or directly facing away from each other (back-to-back).

a. True b. False

Answer: _____ 58. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are

also square to the camera. Is it true that the following code (when run) will result in an infinite loop (it will never end).

a. Yes b. No

Answer: _____ 59. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are

also square to the camera. How far will the flamingo and the hare be from each other after the following code is run?

a. 1.0 meters b. 1.5 meters c. 2.0 meters d. none of the above

Answer: _____

60. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. In what direction will the flamingo be facing after the following code is run?

a. towards the camera b. directly away from the camera c. the same direction as it began d. the opposite direction as it began

Answer: _____

61. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. In what direction will the hare be facing after the following code is run?

a. towards the camera b. directly away from the camera c. the same direction as it began d. the opposite direction as it began

Answer: _____

62. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. If the below "loop" in "world.my first method" is changed from 2 to 1000 times, what is the closest that the flamingo and hare will ever be from each other when the following code is run?

a. they will collide eventually b. 2.0 meters c. 2.5 meters d. it is unknown

Answer: _____ 63. The following Alice world consists of a flamingo and a hare. The flamingo and hare are 2.5 meters apart, facing each other. They are also square to the camera. True or false: If the below "loop" in "world.my first method" is changed from 2 to 1000 times, the hare will eventually walk off the screen (and keep walking away) when the following code is run.

a. True b. False

Answer: _____

top related