Question
C++ please write a program that compiles and run. PA1 program is in this link of CHEGG. https://www.chegg.com/homework-help/questions-and-answers/c-create-database-employees-organization-meeting-following-requirements--employee-employee-q34365290 In this project, you will modify PA1
C++ please write a program that compiles and run. PA1 program is in this link of CHEGG.
https://www.chegg.com/homework-help/questions-and-answers/c-create-database-employees-organization-meeting-following-requirements--employee-employee-q34365290
In this project, you will modify PA1 by creating Employee class and apply separate compilation. Your program must not interact with the user to receive inputs for efficiency in testing programs, while meeting the following requirements.
Employee class
Change the struct data type Employee to a class with all preexisting attributes(, or data members, or data fields) and an additional data member named count that keeps track of the number of Employee objects.
Implement the interface that include the following functionalities
An Employee object can be created with its data members set to default values
An Employee object can be created with its data members set to values according to parameters.
An Employee object notifies being out of scope when it is.
Each data member can be retrieved
department and role can be set individually
salary can be increased by 5 - 10 %
department, role and salary can be changed simultaneously.
All data members can be displayed at once
Prevent accidental modification of data members if unnecessary
Prevent multiple inclusion of the Employee class by adding preprocessor directive: ifndef, define, endif
Have the class declaration in .h and define all member functions in .cpp
main() : use and test the Employee class
Create an employee DB with 5 employees by using dynamic array allocation
Before moving to b, make sure that each employee is unique. For this, you can manipulate data members of an employee with your choice.
Display information of all employees on the console
Display the average salary of all employees on the console
Display information of programmers only on the console
Increase the salaries of all managers by random percentage and display the results
Reassign an employee to a different department and role with increased salary and display the result.
Create another employee with a parameter constructor and display the employee information.
Also, display the number of employees.
Release any dynamically allocated memory in your program without memory leak
Reset any pointer variable if it is not used any longer. Otherwise, such pointer becomes a dangling pointer pointing to a memory that has been deleted already.
Apply indentations correctly to make your program readable.
makefile
Provide makefile to apply separate compilation
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started