Solved

Which of the Following Statements A), B) or C) Is

Question 38

Multiple Choice

Which of the following statements a) , b) or c) is false?


A) With inheritance, every object of a subclass also may be treated as an object of that subclass's base class.
B) We can take advantage of this xe ""derived-class-object-is-a-base-class-object" relationship[derived class object is a base class object relationship]""subclass-object-is-a-base-class-object" relationship to place objects related through inheritance into a xe "list of base-class objects"list, then iterate through the list and treat each element as a base-class object.
C) The following code places CommissionEmployee and SalariedCommissionEmployee objects (c and s) in a list, then for each element displays its string representation and earnings-this is an example of xe "polymorphism"polymorphism:
In [21]: employees = [c, s]
In [22]: for employee in employees:
) ..: print(employee)
) ..: print(f'{employee.earnings() :,.2f}\n')
) ..:
CommissionEmployee: Sue Jones
Social security number: 333-33-3333
Gross sales: 20000.00
Commission rate: 0.10
2,000.00
SalariedCommissionEmployee: Bob Lewis
Social security number: 444-44-4444
Gross sales: 10000.00
Commission rate: 0.05
Base salary: 1000.00
1,500.00
D) All of the above statements are true.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents