Practice Problem (Inheritance)
Problem Statement
Suppose you are required to design and implement an Employee Management System for a
company using C++ Object-Oriented Programming. The system should handle information about
various roles in the company, such as employees, managers, engineers, and interns.
The requirements are:
• All employees have common details like name, employee ID, and department.
• Managers have additional attributes like team size and project name.
• Engineers have attributes like specialization (e.g., software, electrical) and programming
language.
• Interns are engineers but have extra attributes such as university name and duration of
internship.
Your task is to analyze the given roles and their relationships, then determine the most suitable
type(s) of inheritance to implement the system, this may include single, multilevel, hierarchical,
or multiple inheritance. Based on your analysis, design appropriate classes with relevant attributes
and constructors to represent each role. In the main() function, create objects of the different roles,
take input from the user for each, and display their information using class-specific functions.
CS-107 Computer Programming Engr. Eman Fatima
Problem Statement
Suppose you are required to design and implement an Employee Management System for a
company using C++ Object-Oriented Programming. The system should handle information about
various roles in the company, such as employees, managers, engineers, and interns.
The requirements are:
• All employees have common details like name, employee ID, and department.
• Managers have additional attributes like team size and project name.
• Engineers have attributes like specialization (e.g., software, electrical) and programming
language.
• Interns are engineers but have extra attributes such as university name and duration of
internship.
Your task is to analyze the given roles and their relationships, then determine the most suitable
type(s) of inheritance to implement the system, this may include single, multilevel, hierarchical,
or multiple inheritance. Based on your analysis, design appropriate classes with relevant attributes
and constructors to represent each role. In the main() function, create objects of the different roles,
take input from the user for each, and display their information using class-specific functions.
CS-107 Computer Programming Engr. Eman Fatima