Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you write this code for me in C++? E.3. Question 3: Class and objects Employee Database Create a class called Employee with four member

Can you write this code for me in C++?
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
E.3. Question 3: Class and objects Employee Database Create a class called "Employee with four member variables (First name, last name, employee ID, and salary) to store information about employees, and a member function to display those information. Now carry out the following program requirements Page 7 of 12 Program Requirements: No Global variables can be used for this program. You are required to use the function prototypes given below. In the main function, ask the user to enter the size (number of employees. By using this size, create an Employee type amay dynamically From the main0 function, a function should be called to populate the employee array Define this function with the function prototype: void dataEntry(Employee edb [],int size) where in the parameter list the first parameter edb will take care of the employee amay and the second parameter size will take care of the size of the array. Inside this function, validate that the salary is a positive number and validate the employee ID is a 5 digit number The program will then display a menu showing the following options: a. Sort the contents of the amay in the order from the greatest to least with respect to the salary of the employee. This function should not contain any cout The function prototype: void sort Array salary(Employee myArray int sz) b. Sort the contents of the array in alphabetical order with respect to the last name of the employee. This function should not contain any cout statement. The function prototype: void sortArrayLName(Employee nyArray[1, int sz) c. Find the average salary. The function prototype: double find AverageSalary(Enployee myArray[], int sz) d. Search the array with the given ID number and display the employee info if found, otherwise display "Not found The function prototype: void searchArrayID(Employee myArray[], int sz, int ID) In the above prototype, the ID variable should take care ofthe employee tobe e. Search the amay with the given first name and display the employees info if found otherwise display "Not found' The function prototype void searc hArray FName (Employee nyArray[1, int sza string fane) In the above prototype, the string variable should take care of the employee to be f Search the amay with two given salaries and display all the employees whose salaries are between them otherwise display "Not f The function prototype: hArray (Employee smyArray, int sz, double salary.low, double salary high

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions