Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions

Question

1. Why do people tell lies on their CVs?

Answered: 1 week ago

Question

2. What is the difference between an embellishment and a lie?

Answered: 1 week ago