| Title | Open | |||
|---|---|---|---|---|
| 124 | Basic Public InheritanceA base class Animal has been provided with a protected string name, a constructor that initializes it, and a function getName() that returns the name. | easy | Not started | Solve |
| 125 | Accessing Protected MembersA base class Person has been provided with a protected string name and a constructor that initializes it. | easy | Not started | Solve |
| 126 | Constructor Call OrderA base class Vehicle has been provided with a protected int speed and a constructor that sets it. | easy | Not started | Solve |
| 127 | Function OverridingA base class Shape has been provided with a virtual function draw() that prints "Drawing Shape". | easy | Not started | Solve |
| 128 | Calling Base Using Scope ResolutionA base class Employee has been provided with a protected string name, a constructor, and a virtual function print() that prints the name. | easy | Not started | Solve |
| 129 | Is-A RelationshipA base class Account has been provided with a protected double balance, a constructor, and a getBalance() function. | easy | Not started | Solve |
| 130 | Base Pointer to Derived ObjectA base class Animal has been provided with a virtual function sound() that prints "Animal sound" and a virtual destructor. | easy | Not started | Solve |
| 131 | Constructor and Destructor OrderA base class Base has been provided with a constructor that prints "Base constructor" and a virtual destructor that prints "Base destructor". | easy | Not started | Solve |
| 132 | Overriding With Same SignatureA base class Printer has been provided with a virtual function print() that is marked const and prints "Printing". | easy | Not started | Solve |
| 133 | Using Protected Instead of PrivateA base class BankAccount has been provided with a protected int accountNumber and a constructor that initializes it. | easy | Not started | Solve |
| 134 | Multi Level InheritanceA three-level inheritance chain has been provided: - Person (base class) with a protected name and getName() function - Student (derived from Person) - GraduateStudent (derived from Student) Your task is to implement the printLevel() function for GraduateStudent. | easy | Not started | Solve |
| 135 | Private Members and GettersA base class Book has been provided with a private string title, a constructor, and a public getter getTitle(). | easy | Not started | Solve |
| 136 | Override and Call Base FunctionA base class Message has been provided with a virtual function display() that prints "Message". | easy | Not started | Solve |
| 137 | Hospital InheritanceA base class Patient has been provided with protected members id (int) and name (string), a constructor, and a virtual print() function that prints the id and name. | easy | Not started | Solve |
| 138 | Employee Engineer InheritanceA base class Employee has been provided with protected members id (int) and name (string), a constructor, and a virtual print() function. | easy | Not started | Solve |
| 429 | Passing Arguments to Base ConstructorCreate a base class Vehicle and a derived class Car. | easy | Not started | Solve |
| 430 | Default Argument in Base ConstructorCreate a base class Greeter and a derived class EnglishGreeter. | easy | Not started | Solve |
| 431 | Using the Override KeywordCreate a base class Bird with a virtual method string sound() const that returns "generic". | easy | Not started | Solve |
| 432 | Inherited Method Without OverrideA derived class automatically inherits the public methods of its base. | easy | Not started | Solve |
| 433 | Protected Helper MethodA protected method can be called by a derived class but not from outside the hierarchy. | easy | Not started | Solve |
| 434 | Grandchild Calls Grandparent MethodIn a three-level hierarchy, the most-derived class inherits methods from ALL of its ancestors. | easy | Not started | Solve |
| 435 | Polymorphism Through a Base ReferenceVirtual dispatch works through base REFERENCES, not only pointers. | easy | Not started | Solve |
| 436 | Virtual Destructor CleanupWhen you delete a derived object through a base pointer, the base destructor MUST be virtual so the derived destructor also runs. | easy | Not started | Solve |
| 437 | Preventing Override With FinalThe final specifier stops a virtual method from being overridden by any further subclass. | easy | Not started | Solve |
| 438 | Age Check Using an Inherited FieldA derived class can build new logic on top of a field it inherits. | easy | Not started | 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 | Solve |
| 440 | Reusing an Inherited Setter and GetterWhen base data is private, a derived class cannot touch it directly and must go through the inherited public accessors. | easy | Not started | Solve |
| 139 | Derived Class With New MembersYou are given a base class Shape with a protected string color and a constructor. | medium | Not started | Solve |
| 140 | Polymorphism Through Base PointerYou are given a base class Animal with a virtual function speak() that prints "..." and a virtual destructor. | medium | Not started | Solve |
| 141 | Inheriting and Extending a ConstructorYou are given a base class Person with protected members name (string) and age (int), plus a constructor and a virtual display() function. | medium | Not started | Solve |
| 142 | Override With Base Call and Extra LogicYou are given a base class Logger with a virtual function log() that prints a timestamp message. | medium | Not started | Solve |
| 143 | Multi-Level Inheritance With OverridesYou are given a base class Vehicle with a protected int speed and a virtual function describe(). | medium | Not started | Solve |
| 144 | Virtual Function With Return ValueYou are given a base class Employee with protected members name (string) and baseSalary (double), a constructor, and a virtual function calculatePay() that returns baseSalary. | medium | Not started | Solve |
| 289 | Derived Class Adds a MethodThe base class Vehicle stores a protected speed and has a getSpeed() method. | medium | Not started | Solve |
| 441 | Name Hiding in a Derived ClassWhen a derived class declares ANY method with a given name, it hides ALL base methods of that same name (even overloads with different parameters). | medium | Not started | Solve |
| 442 | Using Declaration to Unhide Base OverloadsA using declaration brings hidden base overloads back into a derived class's scope so they can be called WITHOUT qualification. | medium | Not started | Solve |
| 443 | Protected Inheritance AccessWith protected inheritance, the base class's PUBLIC members become PROTECTED in the derived class: outside code can no longer call them, but the derived class's own methods still can. | medium | Not started | Solve |
| 444 | Private Inheritance BasicsWith private inheritance, the base class's public interface becomes PRIVATE in the derived class. | medium | Not started | Solve |
| 445 | Multiple Inheritance BasicsA class can inherit from more than one base class at the same time, gaining the members of all of them. | medium | Not started | Solve |
| 446 | Downcasting With static_castA static_cast can convert a base pointer down to a derived pointer when you already know the real object type, letting you call methods that only exist on the derived class. | medium | Not started | Solve |
| 447 | Object Slicing DemonstrationCopying a derived object into a base OBJECT (by value) slices off the derived part, and virtual dispatch no longer reaches the override. | medium | Not started | Solve |
| 448 | Interface With Two Pure Virtual MethodsAn interface is an abstract class made only of pure virtual methods. | medium | Not started | Solve |
| 449 | Counting Objects With a Static Base MemberA static data member in a base class is shared across the whole hierarchy, so it can count every object created, including derived ones. | medium | Not started | Solve |
| 290 | Abstract Base Class With Pure VirtualThe abstract base class Shape declares a PURE VIRTUAL method area() (it has no body, ending in = 0). | hard | Not started | Solve |
| 291 | Polymorphic Array of ShapesThe abstract base class Shape declares a pure virtual area(). | hard | Not started | Solve |
| 292 | Polymorphic Salary CalculationThe base class Employee has a totalPay() method that returns baseSalary plus the result of the VIRTUAL method bonus() (which returns 0 by default). | hard | Not started | Solve |
| 450 | Diamond Problem With Virtual InheritanceWhen two classes inherit from the same base and a fourth class inherits from both, you get the "diamond problem": two copies of the base and ambiguous member access. | hard | Not started | Solve |
| 451 | Dynamic Cast to a Derived Typedynamic_cast safely converts a base pointer to a derived pointer at RUNTIME: it returns a valid pointer if the object really is that type, or nullptr if it is not. | hard | Not started | Solve |
| 452 | Covariant Return Types With CloneAn overriding virtual function may return a pointer to a MORE derived type than the base declares. | hard | Not started | Solve |
| 453 | Pure Virtual Function With a DefinitionA pure virtual function (= 0) makes its class abstract, but it may STILL have a body defined out of the class. | hard | Not started | Solve |