Write C++ functions to handle the following tasks. You are supposed to store data of multiple Employees. Employee has attributes name, gender, designation and salary. Consider prototype of getEmp function Employee getEmp( ) This function declares a variable of Employee, takes input and returns it. In main function declare 10 size array of type Employee, fill each index of array by calling getEmp function. Pass this array to another function named highlyPaid this function returns the highly paid employee, second highly paid employee and third highly paid employee in an array of size 3 of type Employee.
Q.No.8.
Write C++ functions to handle the following tasks. You are supposed to store data of multiple Employees. Employee has attributes name, gender, designation and salary. Consider prototype of getEmp function
Employee getEmp( )
This function declares a variable of Employee, takes input and returns it.
In main function declare 10 size array of type Employee, fill each index of array by calling getEmp function.
Pass this array to another function named highlyPaid this function returns the highly paid employee, second highly paid employee and third highly paid employee in an array of size 3 of type Employee.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images