Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem Specication: The PC Pine Furniture Company has recently hired you to help them generate a payroll report for their employees. You need to define
Problem Specication: The PC Pine Furniture Company has recently hired you to help them generate a payroll report for their employees. You need to define an Employee structure, data members are {id, name, hours worked, rate of pay and gross pay}. You need to define an array of structures for all 20 employees. The data is stored in the included le \"data.txt\". You need to write a function(s) that reads the 20 records from the data le, nds the gross for each employee, and then prints each employee's record. Further, we need to display a menu to select one of the following options. 0 Print the Id, name and gross pay for all the employees whose gross is above a given salary supplied as input from the keyboard. (linear search) 0 Perform a binary search to locate and print the id and gross pay of all employees whose gross is greater than a given salary supplied as input from I the keyboard. To do that, you need to sort the arrays in ascending order based on the gross pay then use a binary search function to return the position if found. Make sure you handle multiple gross pays of the given salary, if any. 0 Sort the array, in ascending order, based on id, using the selection sort (procedure is in the book), count the number of swaps it took before the array became sorted. Print the counter and the sorted array. 0 Perform a binary search that will display the id, name, hours worked, rate of pay and gross pay for a requested id, this should repeat until the user enters 'n' or 'N' in response to a prompt. Requirements: I none of the variables are declared globally. I Every function must have specications. 0 Make sure every function accomplishes its task and is self-contained 0 Use typedef to define new types as necessary. 0 Each output has a heading and labels to identify information. 0 Must test if data le exists before reading data. - main is used as a driver function, no inputfoutput or calculations are done in main, only what is specied. - Outputs are sent to 1e(s)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started