Exam 12: Father Was a Rectangle: Inheritance and Object-Oriented Design

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

How do you call the constructor of a superclass within a subclass?

Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
Verified

B

The constructor method is always named __init__.

Free
(True/False)
5.0/5
(39)
Correct Answer:
Verified

True

The ____ relationship describes two objects where one object is a more specific instance of the other.

Free
(Multiple Choice)
4.8/5
(36)
Correct Answer:
Verified

C

How does a Python object reference the class of which it is an instance?

(Essay)
4.8/5
(42)

Match each definition with its term. -A more specific class.

(Multiple Choice)
4.8/5
(35)

It is good programming practice to write all the code for a large program at once and then to test it.

(True/False)
4.9/5
(37)

Describe the visibleObject instance variable that was added to the Canvas class presented in your text. How does this variable help improve drawing?

(Essay)
4.8/5
(40)

When designing a project, it is a good idea to begin by making a list of the different kinds of objects involved and the relationships between those objects.

(True/False)
4.8/5
(38)

The ____ method of the screen is used to define the width and height.

(Multiple Choice)
5.0/5
(34)

Match each definition with its term. -The class from which all classes inherit.

(Multiple Choice)
4.9/5
(42)

Explain the benefits of using inheritance when creating a program that uses a variety of shapes with common characteristics.

(Essay)
4.8/5
(38)

The ______ relationship describes two objects where one object uses another object.

(Multiple Choice)
4.7/5
(36)

The class where the IS-A link originates is called the superclass.

(True/False)
4.8/5
(44)

How do you designate that B is a parent class of A?

(Multiple Choice)
4.8/5
(36)

What is the difference between an IS-A relationship and a HAS-A relationship?

(Essay)
4.9/5
(37)

In the object hierarchy presented in the text, GeometricObject is a(n) ____ class.

(Multiple Choice)
4.9/5
(33)

When two classes are connected by an IS-A link, what do we call a class that inherits from a higher class in the inheritance hierarchy?

(Multiple Choice)
4.8/5
(34)

Case Study 2: 1. >>> myLine 2. <draw.Line object at 0x106f6b0> 3. >>> myCanvas 4. <draw.Canvas instance at 0x1070328> 5. >>> isinstance(myLine, Line) 6. ?????? -Refer to the session in the accompanying Case Study 2. What is output on line 6?

(Multiple Choice)
4.8/5
(34)

In a hierarchy diagram, the most ____ object is at the top.

(Multiple Choice)
4.9/5
(30)

What variable holds the name of the parent of a class?

(Multiple Choice)
4.7/5
(33)
Showing 1 - 20 of 32
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)