Question: Question [65 Marks] Write a complete Ch program. The program tes various types of structured data developed to calculate the salary of each employee and

 Question [65 Marks] Write a complete Ch program. The program tes
various types of structured data developed to calculate the salary of each
employee and the total salary to be paid for each department The

Question [65 Marks] Write a complete Ch program. The program tes various types of structured data developed to calculate the salary of each employee and the total salary to be paid for each department The program should perform the following tasks Task 1: Declare a structure named Peployee, with the following members (3 marks) a) Name b) Department c) Basic salary d) Number of overtime hours worked in coe mouth e) Overtime pay 1 Total salary including overtime pay Task 2: Write a function named readinput (14 marks) a) It receives an array of Employee of type struct b) The function should read data from the given input file named input.txt. The file contains employees department basic salary, number of overtime hours worked in one mouth, and name. Figure I shows an example of data that can be used to test the program c) Asuming you do not know, the number of employees Calculate the number of employees available in the company based on the number of employee records found in the input file d) The function should return the sumber of employees calculated in (c) Production 3500 29 San Quality 1000 45 ans sa Product 2000 53 Rashid Product 1100 W Quality 2400 15 want me Engineering 2100 27 in Xa Accounting 35000 Engineering 21101 LANTS Engineering 24 than Quality 3213 Cat Thani count 2018 rabas But I Band Kasi 2010 J5 Sofia A conting 34532 Figure 1Sanuple data in the spot file input.txt" Task 3: Write a function and determinato 6 marks *) It takes the department importante b) The function should rerum overtime ate based on the information gives Table 1 Department Qualty Production Accounting Engineering Table 1 Overtime Rate (RM per hour) 115 10.0 125 15.0 Task 4: Write a function named displayOutput (11 marks) a) This is a non-returning function b) It takes an array of Employee of type struct and the number of employees calculated in Task 2 as input parameters c) The function should display employees' names, department, basic salary. number of overtime (OT) hours worked in one month, monthly overtime (OT) pay, and monthly salary. The formia for calculating monthly overtime (OT) pay and monthly salary is as follows: Monthly overtime (OTpay Overtime rate Number of overtime hours worked Monthly salary - Monthly overtime pay Basic salary d) Figure 2 shows an example of the output that will be displayed on the screen based on the data in the input file "input.txt" shown in Figure 1 CERARDOT 123 SALATUD OTROCI OT VAT 270.00 Salman his Hani Hasta Rashid Malt Hashim BASIC 2500.00 20.00 2000.00 150.00 200.00 Production Qualsy Prots Proin Quality Lagiste Accounting 43 53 300.00 02.0 25 270.00 2217.50 2530.00 2890.00 29.50 3706.00 2950.00 3279.50 3110.00 2910.00 249.00 1700.00 600.00 950.00 3 23 53 39.50 Eng Engine 20.00 335.00 Bath aid Rania Russa Eukar Buahan CESE Shax W na Dauda Estlan Saad 0:00 17.00 450.00 20 Acce 21.10.00 21000 240.00 15.50 2028.00 Figure 2: Expected output for Tack 4 Task 5: Write a function named displayanalysis. (17 marks) A) This is a non-euning fractica b) It takes an any of Employee of type struct and the number of employees calculated in Task 2 as put parameters c). The faction should display department es total monthly overtime (OT) pays, and total moothly salary d) Figure 3 shows example of the output that will be displayed on the screen based on the data is the input file input.txt" shown us Figure DEPARTIENT Production Quality Engineering Accounting TOT. OT PAY (0) 1380.00 1726.50 2270.00 1775.00 TOT, SALARY (BM) 7650.00 10066.50 11770.00 11155.00 Figure 3: Expected output for Tasks Task 6: Write a main function to perform the following tasks (5 marks) ) Declare one dimensional amay variable with 50 elements for a structure type Pamployee b) The function may need to call the functions that are defined in the previous task to produce the output as shown in Figure 4. Fote: Please use proper output formatting c) Figure 4 shows the complete output that will be displayed on the screen based on the data in the input file "input.txt" shown in Figure 1. C. Salman Ali Hanit Halal Rashid Abu Malin Hashim and a Axsna sa kas Zarish and Pani Hassan Buhari Tahan CLEE Shari Ami Asha Daud Kasim Sofian Saad Aman BASIC ROOT HOUR OT PAYROL SALARY Predes con 2500.00 270.00 2990.00 Quality 1800.00 45 5:7.50 2217.30 Production 2000.00 sa 530.00 2530.00 Production 1000.00 50 500.00 2310.00 Quality 2400.00 35 403.50 2002.00 Engineering 2000.00 400.00 2705.00 Accounting 2000.00 36 450.00 2950.00 Quality 3000.00 22 279.10 2479.30 Engineer 2250.00 sa 150.00 2130.00 Inne 2250.00 44 60.00 2920.00 Quist 250.00 3 439.00 267.00 des 3210.00 36 400.00 2700.00 ALL 210.00 41 $13.50 3.50 EIN 2500.00 35 320.00 3025.00 Accounting 2419.00 1050 TOTOT TAX200 TOTAL 1560.00 0.00 93.00 30000.0 21770.00 195.00 DERARTIGE Podacsson Enginn sing Figure 4: Complete output for the data from the input file "input.txt" Task 7 List all function prototypen (4 markt) (5 marks) Task 8: You must ensure you program fulfill the following criteria a) The program is able to run b) All requued beader file we included

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!