CJCoding With Joseph
TitleTopicsAction
124
Basic Public InheritanceA base class Animal has been provided with a protected string name, a constructo...
easy○ Not Started
Inheritance
Solve
125
Accessing Protected MembersA base class Person has been provided with a protected string name and a constru...
easy○ Not Started
Inheritance
Solve
126
Constructor Call OrderA base class Vehicle has been provided with a protected int speed and a construc...
easy○ Not Started
Inheritance
Solve
127
Function OverridingA base class Shape has been provided with a virtual function draw() that prints ...
easy○ Not Started
Inheritance
Solve
128
Calling Base Using Scope ResolutionA base class Employee has been provided with a protected string name, a construc...
easy○ Not Started
Inheritance
Solve
129
Is-A RelationshipA base class Account has been provided with a protected double balance, a constr...
easy○ Not Started
Inheritance
Solve
130
Base Pointer to Derived ObjectA base class Animal has been provided with a virtual function sound() that print...
easy○ Not Started
Inheritance
Solve
131
Constructor and Destructor OrderA base class Base has been provided with a constructor that prints "Base constru...
easy○ Not Started
Inheritance
Solve
132
Overriding With Same SignatureA base class Printer has been provided with a virtual function print() that is m...
easy○ Not Started
Inheritance
Solve
133
Using Protected Instead of PrivateA base class BankAccount has been provided with a protected int accountNumber an...
easy○ Not Started
Inheritance
Solve
134
Multi Level InheritanceA three-level inheritance chain has been provided: - Person (base class) with a ...
easy○ Not Started
Inheritance
Solve
135
Private Members and GettersA base class Book has been provided with a private string title, a constructor, ...
easy○ Not Started
Inheritance
Solve
136
Override and Call Base FunctionA base class Message has been provided with a virtual function display() that pr...
easy○ Not Started
Inheritance
Solve
137
Hospital InheritanceA base class Patient has been provided with protected members id (int) and name ...
easy○ Not Started
Inheritance
Solve
138
Employee Engineer InheritanceA base class Employee has been provided with protected members id (int) and name...
easy○ Not Started
Inheritance
Solve
429
Passing Arguments to Base ConstructorCreate a base class `Vehicle` and a derived class `Car`. `Vehicle` is already w...
easy○ Not Started
Inheritance
Solve
430
Default Argument in Base ConstructorCreate a base class `Greeter` and a derived class `EnglishGreeter`. `Greeter` s...
easy○ Not Started
Inheritance
Solve
431
Using the Override KeywordCreate a base class `Bird` with a virtual method `string sound() const` that ret...
easy○ Not Started
Inheritance
Solve
432
Inherited Method Without OverrideA derived class automatically inherits the public methods of its base. Base cla...
easy○ Not Started
Inheritance
Solve
433
Protected Helper MethodA `protected` method can be called by a derived class but not from outside the h...
easy○ Not Started
Inheritance
Solve
434
Grandchild Calls Grandparent MethodIn a three-level hierarchy, the most-derived class inherits methods from ALL of ...
easy○ Not Started
Inheritance
Solve
435
Polymorphism Through a Base ReferenceVirtual dispatch works through base REFERENCES, not only pointers. Base class `...
easy○ Not Started
Inheritance
Solve
436
Virtual Destructor CleanupWhen you `delete` a derived object through a base pointer, the base destructor M...
easy○ Not Started
Inheritance
Solve
437
Preventing Override With FinalThe `final` specifier stops a virtual method from being overridden by any furthe...
easy○ Not Started
Inheritance
Solve
438
Age Check Using an Inherited FieldA derived class can build new logic on top of a field it inherits. Base class `...
easy○ Not Started
Inheritance
Solve
439
Sharing a Static Constant Through InheritanceA `static` member of a base class is shared by the base and every derived class....
easy○ Not Started
Inheritance
Solve
440
Reusing an Inherited Setter and GetterWhen base data is `private`, a derived class cannot touch it directly and must g...
easy○ Not Started
Inheritance
Solve
139
Derived Class With New MembersYou are given a base class Shape with a protected string color and a constructor...
medium○ Not Started
ClassesInheritance
Solve
140
Polymorphism Through Base PointerYou are given a base class Animal with a virtual function speak() that prints "....
medium○ Not Started
ClassesInheritance
Solve
141
Inheriting and Extending a ConstructorYou are given a base class Person with protected members name (string) and age (...
medium○ Not Started
ClassesInheritance
Solve
142
Override With Base Call and Extra LogicYou are given a base class Logger with a virtual function log() that prints a ti...
medium○ Not Started
ClassesInheritance
Solve
143
Multi-Level Inheritance With OverridesYou are given a base class Vehicle with a protected int speed and a virtual func...
medium○ Not Started
ClassesInheritance
Solve
144
Virtual Function With Return ValueYou are given a base class Employee with protected members name (string) and bas...
medium○ Not Started
ClassesInheritance
Solve
289
Derived Class Adds a MethodThe base class `Vehicle` stores a protected speed and has a getSpeed() method. C...
medium○ Not Started
Inheritance
Solve
441
Name Hiding in a Derived ClassWhen a derived class declares ANY method with a given name, it hides ALL base me...
medium○ Not Started
Inheritance
Solve
442
Using Declaration to Unhide Base OverloadsA `using` declaration brings hidden base overloads back into a derived class's s...
medium○ Not Started
Inheritance
Solve
443
Protected Inheritance AccessWith `protected` inheritance, the base class's PUBLIC members become PROTECTED i...
medium○ Not Started
Inheritance
Solve
444
Private Inheritance BasicsWith `private` inheritance, the base class's public interface becomes PRIVATE in...
medium○ Not Started
Inheritance
Solve
445
Multiple Inheritance BasicsA class can inherit from more than one base class at the same time, gaining the ...
medium○ Not Started
Inheritance
Solve
446
Downcasting With static_castA `static_cast` can convert a base pointer down to a derived pointer when you al...
medium○ Not Started
Inheritance
Solve
447
Object Slicing DemonstrationCopying a derived object into a base OBJECT (by value) slices off the derived pa...
medium○ Not Started
Inheritance
Solve
448
Interface With Two Pure Virtual MethodsAn interface is an abstract class made only of pure virtual methods. A concrete ...
medium○ Not Started
Inheritance
Solve
449
Counting Objects With a Static Base MemberA `static` data member in a base class is shared across the whole hierarchy, so ...
medium○ Not Started
Inheritance
Solve
290
Abstract Base Class With Pure VirtualThe abstract base class `Shape` declares a PURE VIRTUAL method `area()` (it has ...
hard○ Not Started
Inheritance
Solve
291
Polymorphic Array of ShapesThe abstract base class `Shape` declares a pure virtual `area()`. Complete BOTH ...
hard○ Not Started
Inheritance
Solve
292
Polymorphic Salary CalculationThe base class `Employee` has a `totalPay()` method that returns baseSalary plus...
hard○ Not Started
Inheritance
Solve
450
Diamond Problem With Virtual InheritanceWhen two classes inherit from the same base and a fourth class inherits from bot...
hard○ Not Started
Inheritance
Solve
451
Dynamic Cast to a Derived Type`dynamic_cast` safely converts a base pointer to a derived pointer at RUNTIME: i...
hard○ Not Started
Inheritance
Solve
452
Covariant Return Types With CloneAn overriding virtual function may return a pointer to a MORE derived type than ...
hard○ Not Started
Inheritance
Solve
453
Pure Virtual Function With a DefinitionA pure virtual function (`= 0`) makes its class abstract, but it may STILL have ...
hard○ Not Started
Inheritance
Solve