Question: #include #include #include #include #include #include afile with four parameters LastName FirstName Salary ID. Parameters are separated by a single whitespace character. Write a structure

 #include #include #include #include #include #include afile with four parameters LastName

#include #include #include #include #include #include afile with four parameters LastName FirstName Salary ID. Parameters are separated by a single whitespace character. Write a structure named Employee with a parameter for each four member variables. Declare a structure pointer and assign dynamic memory to store the data from the file. Prompt the user for the number of Employees. assume that the usEr knows how large the file is. Read the file one line at a time and assign the read parameters to the appropriate structure variables, add the salary of the employees while you are reading them. Close the file and compute the average of the salaries after you are done reading. Open a separate file for writing. In the output file, write the parameters but only if the salary of the employee is greater than the average salary. The output file must be in the following format ID Salary The salary must have 2 digits after the decimal point. Both ID and Salary fields must be right aligned and must have 12 spaces dedicated to each of them. Submit your output file along with the code. Use HW1Prob1.dat file to solve this problem. HW1Prob1.dat file contents John Harris 50000.00 113785 Lisa Smith 75000.487 254785 Adam Johnson 68500.10 321258 Sheila Smith 150000.50 165478 Tristen Major 75800.76 102596 Yannic Lennart 58000.55 369854 Lorena Emil 43000.00 225478 Tereza Santeri 48000.001 136478

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!