Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If there are three classes, Shape, Circle and Square, what is the most likely re

ID: 3614650 • Letter: I

Question

If there are three classes, Shape, Circle and Square, what is the most likely relationship among them?
a. Square is a base class, and shape and circle are derived classes of Square.
b. Shape is a base class, and circle and square are derived classes of Shape.
c. Shape, circle and square are all sibling classes.
d. These three classes cannot be related.


If class Dog has a derived class Retriever, which of the following is true?
a. In the case of single inheritance, Dog can have no other derived classes.
b. In the case of single inheritance, Retriever is derived from no other class except Dog.
c. The relationship between these classes implies that Dog “is a” Retriever.
d. The relationship between these classes implies that Retriever “has-a” Dog.

Explanation / Answer

If there are three classes, Shape, Circle and Square, what is the most likely relationship among them? a. Square is a base class, and shape and circle are derived classes of Square. b. Shape is a base class, and circle and square are derived classes of Shape. c. Shape, circle and square are all sibling classes. d. These three classes cannot be related. Circle and Square are both shapes so classes Circle and Square mustbe the derived classes. So my answer will be letter b. If class Dog has a derived class Retriever, which of the following is true? a. In the case of single inheritance, Dog can have no other derived classes. b. In the case of single inheritance, Retriever is derived from no other class except Dog. c. The relationship between these classes implies that Dog “is a” Retriever. d. The relationship between these classes implies that Retriever “has-a” Dog. In single inheritance, classes have only onebase class and since Dog is the base class then the answer would beletter b. I did not choose letters c and d because letter c shouldhave been, "...Dog has-a Retriever." and letter d should be"...Retriever is a Dog".