1. why do we need inheritance in C++?
inheritance is in everything in the real world just like in the programming world. Different programming languages inherit different properties front earlier programming languages. inheritance involves creating new objects by directly acquiring the attributes and behaviors of other objects and than extending them or specializing them.
2. Give a simple example of objects in the real world that could be modelled in C++ using inheritance.
An oak tree and a pine tree have both inherited the tree properties.
1. What is a superclass and what is a subclass?
The class being inherited from is a super class and the class doing the inhereiting is the sub class.
2. How would you write a public inheritance in C++?
class baseballplayer : public person
3. In what ways can a subclass extend the functionality of a superclass?
By inheriting from a base class, which allows us to use the information already assigned to that clas and apply it to the derived classes.