Question: v PARTC QUESTION 1 (14 MARKS) Given the following struct definition struct Employee string name: string id; string dept; int performanceRating;//1,2,3,4 double salary: }; Write
PARTC QUESTION 1 (14 MARKS) Given the following struct definition struct Employee string name: string id; string dept; int performanceRating;//1,2,3,4 double salary: }; Write a C++ program to do the following: a) Write the definition of function calTotalSalary(Employee []). The function receives an array of employees, calculates and returns the total salary. b) Read the file named employee.txt and store the records into an array of struct variables named emp. There are 50 employee records in the file. The record consists of the employee name, employee id, department, performance rating and salary. ali;1111;finance;4;3500 siti;2222; marketing; 4;3200 sarah; 6666;marketing;3; 2500 azam;1234; human resource;3;2800 shah; 3452; security;2;2008 employee.txt c) Select and write the information of employees from the Marketing and Human Resource into separate file output named marketing.txt and human Resource.txt respectively. Refer sample output files below. d) Select and display the information of employees from the Marketing department whose performance rating is 4. e) Find and display the total salary. Call the appropriate function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
