1. Why do we need inheritance in C++?
It allows to build classes built upon existing classes, to reuse code of the parent class and extend on the existing methods and members.
2. Give a simple example of objects in the real world that could be modelled in C++ using inheritance.
Parent class: Vehicle
Child class: car or truck
Car and truck can have different members and methods since they have different purposes (person vs cargo transfer) but they both inherit from vehicle.
1. What is a superclass and what is a subclass?
A subclass or child class intherits from a superclass or parent class
2. How would you write a public inheritance in C++?
After class declaration, use colon, the word public followed by the name of the class to inherit from
class ChildClass : public ParentClass
3. In what ways can a subclass extend the functionality of a superclass?
A subclass inherits all methods and members of the superclass, it can then add methods and members specific to itself, thus making it an extension of the superclass