Ch.11 Object-Oriented and Event-Driven Programming Test Bank - Practice Test Bank | Prelude Programming 6e Venit by Stewart Venit. DOCX document preview.

Ch.11 Object-Oriented and Event-Driven Programming Test Bank

Test Bank for Prelude to Programming Chapter 11

MULTIPLE CHOICE

1. The practice of data hiding serves which of the following purposes:

a.

it enhances the security of the object’s data

b.

it makes the interface cleaner

c.

it keeps the attributes of an object separate from the object’s methods

d.

all of the above are purposes of data hiding

2. The expression Write Cook.pancakes refers to:

a.

an object named Cook with a member named pancakes

b.

an object named pancakes with a member named Cook

c.

an object named Cook and a method named pancakes

d.

A method named Cook and an object named pancakes

3. Which of the following is not part of the analysis phase of developing an OOP program?

a.

identifying the classes to be used

b.

determining the attributes needed for the classes

c.

determining the methods needed for the classes

d.

determining the relationships among the classes

e.

all of the above are parts of the analysis phase

4. Which of the following is an attribute of a class named Triangle?

a.

SetBase() (assigns a value to the measurement of the base of a triangle)

b.

SetHeight() (assigns a value to the measurement of the height of a triangle)

c.

Area (the area of a triangle)

d.

GetArea() (returns the area of a triangle to the calling module)

5. Given that you have a class named Dog. How would you instantiate two objects of the class Dog named Labrador and Poodle?

a.

Write Labrador, Poodle As Dog

b.

Declare Labrador and Poodle As Dog

c.

Declare Labrador As New Dog

Declare Poodle As New Dog

d.

Declare Dog.Labrador

Declare Dog.Poodle

6. Given that you have an object, Terrier, of the class Dog, and that an attribute of this class is Color, how would you refer to the Color attribute of the Terrier object?

a.

Terrier.Color

b.

Dog.Terrier.Color

c.

Terrier.GetColor()

d.

Call Dog.Terrier.GetColor()

7. Objects are to classes as __________ are to _______________.

a.

integers … numbers

b.

squares … cubes

c.

variables … primitive data types

d.

characters … strings

8. To support object-oriented programming, a programming language must include which of the following features?

a.

encapsulation

b.

inheritance

c.

polymorphism

d.

all of the above

9. If a class named Sedan has all the attributes and methods of a class named Vehicle, but has several other attributes and methods specific only to Sedan, then:

a.

Sedan is the parent class and Vehicle is the base class

b.

Vehicle is the parent class and Sedan is the child class

c.

Sedan is the base class and Vehicle is the parent class

d.

Vehicle is the derived class and Sedan is the base class

10. The operations that can be performed on an object’s data are its:

a.

Attributes

b.

Variables

c.

Methods

d.

parameters

11. Which of the following is the industry standard for system modeling?

a.

Booch method

b.

OMG

c.

Object-oriented software engineering (OOSE)

d.

UML

12. Assume you have a class named Rabbit which has four methods: GetColor(), SetColor(), GetName(), and SetName(). One object of type Rabbit is named MyRabbit and has Color = “white” and Name = “Peter”. Which set of statements would display the following to the screen:

“Peter is a white rabbit.”

a.

Write MyRabbit.GetName()+“ is a “+MyRabbit.GetColor()+“rabbit.”

b.

Write Peter + “ is a “ + White + “ rabbit.”

c.

Write Peter.SetName() + “ is a “ + Peter.SetColor() + “ rabbit.”

d.

Write Rabbit.Peter + “ is a “ + Rabbit.White + “ rabbit.”

13. What is a constructor in a class?

a.

an object

b.

a list of an object’s attributes

c.

an instance of the class that has private methods

d.

a special method that can be used to create objects of the class

14. Assume you have a class named Rabbit which has three attributes: Color, Name, and Breed. How would you create a new object named Bunny of the class Rabbit?

a.

Declare Bunny As New Object

b.

Declare Bunny.Rabbit As New Class

c.

Set Bunny = Rabbit

d.

Declare Bunny As New Rabbit

15. Assume you have a class named Puppy which has two attributes: Breed (a string), and Weight (a float). How would you create a constructor for this class?

a.

Declare Puppy As New Puppy

b.

Public Puppy()

Set Breed = “Poodle“

Set Weight = 15

End Constructor

c.

Public Puppy()

Set Breed = “Poodle“

Set Weight = “15”

End Constructor

d.

You cannot create a constructor for a class that has attributes of different types.

16. Elements in a Graphical User Interface are known as:

a.

Command boxes

b.

components

c.

controls

d.

Either (b) or (c)

17. Which of the following is not a windows component?

a.

check box

b.

radio button

c.

text box

d.

title box

18. Which windows property identifies the name by which the window is known in a program?

a.

name

b.

title

c.

label

d.

A window does not need to be identified in a program.

19. If the name of a window is MyWindow, which of the following will set the width of the window to 200 pixels?

a.

Set MyWindow = 200 px

b.

Set width = 200

c.

Set MyWindow.width = 200

d.

Set width = MyWindow.200

20. in a GUI program, an action that determines the flow of execution is known as a(n):

a.

Click()

b.

timer

c.

GUI

d.

event

TRUE/FALSE

1. True/False: The attributes of an object are the operations that may be applied to it.

2. True/False: An object is a particular instance of its class.

3. True/False: The practice of data hiding helps shield the inner workings of the object from the programmer.

4. True/False: Attributes of a class that are available to code outside that class are public so long as the methods of the class are not available to code outside the class.

5. True/False: If one member of a class is private, all the members of that class must also be declared as private.

6. True/False: To refer to an object and one of its methods, we use dot notation.

  1. True/False: A constructor in a class is a special method that can be used to create objects of that class.

8. True/False: Encapsulation is the ability to create methods that perform a general function which automatically adopts itself to work with objects of different classes.

9. True/False: When a subclass is created, it is known as the base class.

10. True/False: Polymorphism allows a method to take on many definitions when applied to objects in a hierarchy of classes.

11. True/False: An object modeling language is a standardized set of symbols that includes ways to arrange the symbols to model parts of an object oriented software design.

12. True/False: A class can only have one constructor.

13. True/False: UML is important because it helps the designers keep track of what they are doing and what has been done, and helps them devise ways to increase functionality and improve the program through time.

14. True/False: OOP refers to an approach to program design and coding that places an

emphasis on the objects needed to solve a given problem and the relationships among them.

15. True/False: Object-oriented programming can only be implemented through a Graphical User Interface.

16. True/False: Components of a window are considered objects.

17. True/False: GUI controls have both methods and properties.

18. True/False: The assignment statement:

Set ABox.text = “hello!”

will have the word “hello” displayed initially in a text box named ABox.

SHORT ANSWER

1. A(n) __________ is a data type that allows a programmer to create objects.

2. Objects are made up of data and operations on that data, so we say that an object __________ data and operations.

  1. An object’s data is known as its __________ or properties.
  2. Attributes and/or methods of a class that are available to code outside that class are __________.

5. The __________ operation creates an instance of a class.

6. The expression Write Triangle.Height refers to an object named __________.

7. An object’s attributes are initialized, in an OOP language, through the use of a(n) __________.

8. The ability to create new classes based on existing classes is known as __________.

9. When a subclass is created, the __________ and __________ of the parent class automatically become members of the child class.

10. UML, or Unified Modeling Language, is a type of __________ __________ language that is used to create an abstract model of a system.

11. The status of a class member (an attribute or a method) is specified as __________, __________ or protected.

12. Since a child class inherits the members of its parent class and adds some of its own members, we say that the child class __________ the parent class.

13. __________ allows a method to take on many definitions when applied to objects in a hierarchy of classes.

14. UML diagrams represent three different __________ of a system model

15. A list box is similar to a(n) __________- __________ __________ box.

16. The __________ property determines whether or not a control is active.

17. Two components that have a name property are __________ and __________.

18. Each object has a set of events and methods, called __________ __________ associated with it.

Document Information

Document Type:
DOCX
Chapter Number:
11
Created Date:
Aug 21, 2025
Chapter Name:
Chapter 11 Object-Oriented and Event-Driven Programming
Author:
Stewart Venit

Connected Book

Practice Test Bank | Prelude Programming 6e Venit

By Stewart Venit

Test Bank General
View Product →

$24.99

100% satisfaction guarantee

Buy Full Test Bank

Benefits

Immediately available after payment
Answers are available after payment
ZIP file includes all related files
Files are in Word format (DOCX)
Check the description to see the contents of each ZIP file
We do not share your information with any third party