Challenge 3: Implement a Father Class
Explore how to implement inheritance in C++ by creating a Father class with eye and hair color traits, then extend it through Son and Daughter classes that add unique names and print their combined traits.
We'll cover the following...
We'll cover the following...
Problem Statement
Implement a code which have:
- A parent class named
Father.- Inside it define:
eye_colorhair_colorvoid Father_traits()function:- It prints the eye_color and hair_color of the called object
- Inside it define:
- Then, there are two derived classes
Sonclass- has a private member
name - has a function named
Son_traits()which prints traits of the Son
- has a private member