Skip to content

bintcoded/C-Inheritance-and-Polymorphism

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

C++ Inheritance and Polymorphism

Overview

This project builds on an inheritance example demonstrated in class, expanding it by introducing a new CEO class that inherits from the Manager class. The lab is designed to reinforce object-oriented principles in C++, including class inheritance, encapsulation, and modular file organization.

Classes Included

  • Employee -Base class
  • Manager - Inherits from Employee, includes department details
  • CEO - Inherits from Manager, adds a new attribute: shares
  • Main - Driver file to demonstrate functionality

Features

  • Demonstrates multilevel inheritance
  • Proper encapsulation using getters and setters
  • Modular code design with header (.h) and implementation (.cpp) files for each class
  • Outputs object details using class-specific methods

File Structure

Lab03/

  • CEO.h
  • CEO.cpp
  • Manager.h
  • Manager.cpp
  • Employee.h
  • Employee.cpp
  • main.cpp

Sample Output

Enter CEO info: Name: Sara Al-Hachami Salary: 100000 Department: Tech Shares: 5000

CEO Name: Sara Al-Hachami Department: Tech Shares: 5000

About

This project demonstrates multilevel inheritance in C++ by creating an Employee, Manager, and CEO class. It uses encapsulation and modular design to gather user input, display data, and show how class relationships work in a real world scenario.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors