Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[c++] create a database of employees of an organization while meeting the following requirements a. Employee Employee is a struct data type that has the

[c++] create a database of employees of an organization while meeting the following requirements

a. Employee

Employee is a struct data type that has the following attributes, or data members, or data fields struct Employee { string firstName; string lastName; int SSN; string department; Role role(AS AN ENUM DATA TYPE); double salary; };

b. Create an employee DB with 5 employees by using dynamic array allocation

c. Fill the salaries of employees by defining setSalaries() and using a random number generator

d. Fill the roles of employees by defining Role type below and setRoles() with a random number generator enum Role {programmer, manager, director};

e. In order to fill out other data members of each employee, you can do hardcoding or apply random number generator and/or string manipulation or any of your choice, as long as your program does not interact with the user.

f. Display information of all employees on the console

g. Display average salary of all employees on the console h. Display information of programmers only on the console i. Release any dynamically allocated memory in your program without memory leaks

j. 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.

k. Apply indentations correctly to make your program readable.

l. No need of classes/objects m. No need of makefile

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

What is American Polity and Governance ?

Answered: 1 week ago

Question

What is Constitution, Political System and Public Policy? In India

Answered: 1 week ago

Question

What is Environment and Ecology? Explain with examples

Answered: 1 week ago