Question: Question 1 When using the process of tracing objects for problem solving, which types of methods update the values of the instance variables? Question options:
Question 1
When using the process of tracing objects for problem solving, which types of methods update the values of the instance variables?
Question options:
Accessor methods
Mutator methods
Constructors
Both B and C
Question 2
Which statement determines if the middleInit variable is empty or does not refer to any object?
Question options:
if middleInit is None :
print("No middle initial")
if middleInit is not None :
print("No middle initial")
if middleInit == None :
print("No middle initial")
if middleInit != None :
print("No middle initial")
Question 3
What type of method is used to extend or replace the functionality of the superclass method?
Question options:
Concrete method
Abstract method
Overriding method
Constructor method
Question 4
Assume that a Programmer class inherits from an Employee class, and that both classes have an implementation of an increaseSalary method with the same set of parameters. Which class's increaseSalary method is to be executed is determined by:
Question options:
checking whether or not the super function is called in the method body.
the number of instance variables in the class.
the order in which the programmer declared the classes.
the type of the object on which the method is invoked.
Question 5
class Car :
def __init__(self, make, model, color) :
...def getMake(self) :
...def getModel(self) :
...def getColor(self) :
... class Apple :
def __init__(self, color) : ...
def getColor(self) : ...
Question options:
getMake
getModel
getColor
No method is being overridden in this code segment
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
