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

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

What is the name of the property that allows Python to call the right method of an object depending on the type of object referenced by a superclass?

(Multiple Choice)
4.9/5
(31)

In an expanded object hierarchy for shapes, which of the following would be the most specific (or least general) class?

(Multiple Choice)
4.9/5
(40)

Case Study 1: 1. myCanvas = Canvas (800, 600) 2. myLine = Line(Point (-100, -100), Point (100, 100)) 3. myCanvas.draw(myLine) -Refer to the session in the accompanying Case Study 1. What can be inferred about the Point class?

(Multiple Choice)
4.8/5
(30)

The __dict__ variable is a dictionary that keeps track of the methods defined for the class.

(True/False)
4.8/5
(32)

Describe the drawAll method of the Canvas class presented in your text.

(Essay)
4.9/5
(33)

Match each definition with its term. -Provides us with one place to define instance variables and methods used by subclasses.

(Multiple Choice)
4.8/5
(32)

Explain how the Canvas draw method presented in your text makes use of the _draw method in GeometricObject.

(Essay)
4.8/5
(37)

In inheritance, the more general class is called the ____ class.

(Multiple Choice)
4.8/5
(33)

Explain how Python evaluates the expression myLine.getWidth().

(Essay)
4.9/5
(37)

Case Study 1: 1. myCanvas = Canvas (800, 600) 2. myLine = Line(Point (-100, -100), Point (100, 100)) 3. myCanvas.draw(myLine) -Refer to the session in the accompanying Case Study 1. What can be inferred about the Canvas class?

(Multiple Choice)
4.9/5
(27)

What is inheritance? As an example, explain how Shape and a Rectangle are related.

(Essay)
4.8/5
(34)

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

(Multiple Choice)
4.8/5
(38)
Showing 21 - 32 of 32
close modal

Filters

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