Mylab Programming With Pearson Etext -- Access Code Card -- For Starting Out With Python
Mylab Programming With Pearson Etext -- Access Code Card -- For Starting Out With Python
3rd Edition
ISBN: 9780133759112
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 11, Problem 1MC

In an inheritance relationship, the ___________ is the general class.

a. subclass

b. superclass

c. slave class

d. child class

Expert Solution & Answer
Check Mark
Program Description Answer

 In an inheritance relationship, the superclass is referred as “General class”.

Hence, the correct answer is option is “B”.

Explanation of Solution

Inheritance:

In python, it is possible to construct a new class that inherits the members of an existing class, which is referred as “inheritance”.

 “is a” relationship in inheritance:

In python, if one object is a specialized kind of another object, then there should be an “is a” relationship between those objects. This is used to create the “is a” relationship among several classes.

For example:

  • A truck is a vehicle.
  • A circle is a shape.

Super class and sub class:

In python, the inheritance concept involves two classes. They are superclass and subclass.

  • A superclass is also referred as “general class” or “base class” and a subclass is referred as “specialized class” or “derived class”.
  • The sub class is an extended kind of the superclass. This means a subclass can inherit the attributes and class member functions from the superclass without rewriting them in the subclass.
  • Extra methods can be added in the subclass, which implies the specialized kind of the superclass.

Explanation for the incorrect options:

In inheritance, a subclass is referred as “specialized class” or “derived class”.

Hence, option “A” is wrong.

In inheritance, slave class is not present.

Hence, option “C” is wrong.

In inheritance, a subclass is referred as “specialized class” or “derived class” or child class.

Hence, option “D” is wrong.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
01:38
Students have asked these similar questions
You will define three objects class Person, BookAuthor, and Book.  Class Person involves a person's identity. Class BookAuthor involves a collection of books or book titles. Class Book involves the number of books in stock , book title and price. Design the three classes:   The classes must use an appropriate inheritance relationship.   Each class must have a constructor. Each class has at least two private data members and you must include accessors.  You must test your classes by creating a BookAuthor object and printing the Person, Book and BookAuthor values from a function you create inside of BookAuthor. Make sure you use the book object correctly and put it inside of BookAuthor. in pytgi
​This task helps you understand how constructors work in inheritance​ Create a superclass, called SuperClass. Create a constructor for it. Inside the constructor, let it print “this is super class.” Create a childclass of SuperClass, called ChildClass. Create a constructor for it. Inside the constructor, let it print “this is child class.” Create a main function and create a new object for ChildClass. Observe what’s printed in console. What will happen if you have a default constructor without parameters in addition to the one with parameters?
Which type of inheritance is illustrated by the following code? class student{ public: int marks; }; class topper: public student { public: char grade; }; class average{ public: int makrs_needed; }; class section: public average{ public: char name[10]; }; class overall: public average{ public: int students; }; a) Single level b) Multilevel and single level c) Hierarchical d) Hierarchical and single level

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY;License: Standard YouTube License, CC-BY