Deck 7: Object-Oriented Programming
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
Play
Full screen (f)
Deck 7: Object-Oriented Programming
1
For a language to be considered object-oriented,it must support polymorphism,____,and encapsulation.
A) objects
B) class users
C) instantiation
D) inheritance
A) objects
B) class users
C) instantiation
D) inheritance
D
2
Declaring a class creates actual objects.
False
3
A class ____ describes what attributes its objects will have and what those objects will be able to do.
A) profile
B) definition
C) interface
D) signature
A) profile
B) definition
C) interface
D) signature
B
4
____ programming is a style of programming that focuses on an application's data and the methods you need to manipulate that data.
A) Object-oriented
B) Functional
C) Object
D) Method
A) Object-oriented
B) Functional
C) Object
D) Method
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
A program or class that instantiates objects of another prewritten class is a ____ or class user.
A) class slave
B) class object
C) class master
D) class client
A) class slave
B) class object
C) class master
D) class client
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
For a language to be considered object-oriented,it must include ____.
A) get and set methods
B) classes and objects
C) instance variables and methods
D) variables and methods
A) get and set methods
B) classes and objects
C) instance variables and methods
D) variables and methods
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
Polymorphism is the feature of languages that allows the same word or symbol to be interpreted correctly in different situations based on the context.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
Object-oriented programming uses few of the concepts you are familiar with from modular,procedural programming.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
It is possible to create a lengthy chain of inheritance.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
A(n)____ is a term that describes a group of objects with common properties.
A) object
B) interface
C) class
D) method
A) object
B) interface
C) class
D) method
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
The syntax used to declare a class differs among programming languages.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
An ____ of a class is an existing object of a class.
A) example
B) occurrence
C) instance
D) illustration
A) example
B) occurrence
C) instance
D) illustration
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
When an object is created it is ____.
A) instantiatied
B) invoked
C) involved
D) instanced
A) instantiatied
B) invoked
C) involved
D) instanced
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
A class definition can contain four parts.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
When you program in object-oriented languages,you frequently create classes from which objects will be instantiated.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
Although at first,OOP seems to add a layer of complexity to programming logic,after you master it,understanding program logic and working with programs become easier.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
Usually,data fields are public and methods are private.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
Each data variable that exists for every object is called a(n)____ variable.
A) instance
B) class
C) program
D) numeric
A) instance
B) class
C) program
D) numeric
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
In object-oriented terminology,a(n)____ is one concrete example of a class.
A) entity
B) interface
C) method
D) object
A) entity
B) interface
C) method
D) object
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
In object-oriented design,you usually want any outside programs or methods to be able to alter your class's data fields at any time to ensure that the program works.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
Objects are ____,meaning one object can inherit characteristics from another,like objects in the real world.
A) encapsulated
B) extensible
C) invisible
D) definable
A) encapsulated
B) extensible
C) invisible
D) definable
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
____ methods change values within an object.
A) Transformer
B) Change
C) Mutator
D) Get
A) Transformer
B) Change
C) Mutator
D) Get
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
A ____ definition is just an abstract description of what an object will be like if any objects are ever actually instantiated.
A) class
B) prototype
C) accessor
D) signature
A) class
B) prototype
C) accessor
D) signature
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
____ methods assign values to the fields of any objects created from the class.
A) Accessor
B) Set
C) Change
D) Get
A) Accessor
B) Set
C) Change
D) Get
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
A method ____ the version in the base class when it has the same name and parameter list.
A) overhauls
B) redefines
C) overrides
D) overwhelms
A) overhauls
B) redefines
C) overrides
D) overwhelms
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
Each method that each object can use is an ____ method.
A) invoke
B) instance
C) enabled
D) included
A) invoke
B) instance
C) enabled
D) included
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
Because the plus symbol (+)has diverse meanings based on context,it is ____.
A) overdefined
B) defined
C) polyclassist
D) polymorphic
A) overdefined
B) defined
C) polyclassist
D) polymorphic
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
Object-oriented programmers usually specify that their data fields will have ____.
A) public access
B) private access
C) inheritance
D) signatures
A) public access
B) private access
C) inheritance
D) signatures
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
In some languages,a derived class can have more than one parent.This capability is called ____.
A) multiple inheritance
B) multiple heritage
C) multiplicity
D) multiple lineage
A) multiple inheritance
B) multiple heritage
C) multiplicity
D) multiple lineage
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
The term ____ implies that the type's data can be accessed only through methods.
A) abstract type
B) data type
C) abstract data type
D) object data type
A) abstract type
B) data type
C) abstract data type
D) object data type
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
By ____ the data,you pass one argument.
A) encapsulating
B) hiding
C) exposing
D) internalizing
A) encapsulating
B) hiding
C) exposing
D) internalizing
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
A class that inherits from a base class is a ____ class.
A) super
B) lower
C) derived
D) parent
A) super
B) lower
C) derived
D) parent
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
According to the principle of ____,data fields should usually be private,and a client application should be able to access them only through the public interfaces,that is,through the class's public methods.
A) function hiding
B) data hiding
C) data encapsulation
D) data definition
A) function hiding
B) data hiding
C) data encapsulation
D) data definition
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
An ____ is a term that defines the type of access that outside classes will have to the attribute or method.
A) access specifier
B) accessor
C) access interface
D) accessor method
A) access specifier
B) accessor
C) access interface
D) accessor method
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
____ is the ability to create classes that take on the attributes and methods of existing classes,but with more specific features.
A) Heritage
B) Instantiation
C) Heredity
D) Inheritance
A) Heritage
B) Instantiation
C) Heredity
D) Inheritance
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
Each object's features are separate or ____ from all others.
A) refined
B) abstracted
C) encapsulated
D) insulated
A) refined
B) abstracted
C) encapsulated
D) insulated
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
____ describes a language's ability to process objects differently depending on each object's data type.
A) Polysymbolism
B) Polymorphism
C) Polyflexible
D) Polyclassism
A) Polysymbolism
B) Polymorphism
C) Polyflexible
D) Polyclassism
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
____ methods pass the data stored in a field back to a client program.
A) Mutator
B) Send
C) Set
D) Get
A) Mutator
B) Send
C) Set
D) Get
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
When you create a new class using inheritance,you ____ the existing class.
A) stretch
B) expand
C) extend
D) broaden
A) stretch
B) expand
C) extend
D) broaden
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
When you use inheritance you can reuse well-established features of ____.
A) parent classes
B) derived classes
C) child classes
D) subclasses
A) parent classes
B) derived classes
C) child classes
D) subclasses
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
Identify an object that might belong to the Automobile class:
A) string name
B) num price
C) Toyota
D) jet
A) string name
B) num price
C) Toyota
D) jet
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
What features must a programming language have for it to be considered an object-oriented language?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
The following pseudocode is not working correctly.Which answer shows the corrected code? start
Declarations
Product myApple
MyApple.setName = "Gala"
Output "My favorite apple is ",myApple.getName()
Stop
A) Product.setName = "Gala"
B) myApple.setName("Gala")
C) Product = "Gala"
D) Product.setName("Gala")
Declarations
Product myApple
MyApple.setName = "Gala"
Output "My favorite apple is ",myApple.getName()
Stop
A) Product.setName = "Gala"
B) myApple.setName("Gala")
C) Product = "Gala"
D) Product.setName("Gala")
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
Rewrite the following pseudocode making the appropriate corrections.
start
Declarations
Employee myAssistant
myAssistant.setName("Reynolds")
myAssistant.setPayRate = 16.75
output "My assistant ",Employee.getName(),
" makes ",Employee.getPayRate(),
" per hour"
stop
start
Declarations
Employee myAssistant
myAssistant.setName("Reynolds")
myAssistant.setPayRate = 16.75
output "My assistant ",Employee.getName(),
" makes ",Employee.getPayRate(),
" per hour"
stop
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
What is NOT true about the following pseudocode? class Salesperson inheritsFrom Employee
A) Every Salesperson has all the attributes of an Employee
B) Salesperson is a derived class
C) Every Salesperson object can use all Employee methods
D) Salesperson is a base class
A) Every Salesperson has all the attributes of an Employee
B) Salesperson is a derived class
C) Every Salesperson object can use all Employee methods
D) Salesperson is a base class
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
Write the pseudocode for a class named Product that holds a product name.Include methods to get and set the value for each data field.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
The following pseudocode is not working correctly.Which answer shows the corrected code? class Product
Fields
String name
Methods
Void setName(string prodName)
Name = prodName
Return
String getName()
Return
EndClass
A) string getName()
Return name
B) void setName(prodName)
C) string getName(prodName)
Return name
D) string getName(prodName)
Return
Fields
String name
Methods
Void setName(string prodName)
Name = prodName
Return
String getName()
Return
EndClass
A) string getName()
Return name
B) void setName(prodName)
C) string getName(prodName)
Return name
D) string getName(prodName)
Return
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
Which declaration instantiates an object of the Automobile class?
A) myFord Automobile
B) Automobile myFord
C) Transportation myFord
D) Tranportation Automobile
A) myFord Automobile
B) Automobile myFord
C) Transportation myFord
D) Tranportation Automobile
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
List the three parts of a class definition.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
Why do object-oriented programmers usually specify that their data fields will have private access?
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck