Question: Use the structure below to answer the two sub - questions: struct Employee { string name; / / Name of the employee string department; /
Use the structure below to answer the two subquestions:
struct Employee
string name; Name of the employee
string department; Department of the employee
float salary; Employee's salary
int years; Number of years the employee has worked
;
Write a function called printEmployeeStats that takes an array called staff of Employee and its size. The function should calculate and display the average salary and the total years of service for all employees, along with each employee's name, salary, and years of service on a separate line. The output should be formatted as follows:
Name: Employee Name Salary: Salary Years of Service: Years
After listing all employees, display the average salary and total years of service.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
