Question: write in c++,pleasee help,i need fast pleaseee (3 marks) Task 1: Declare a structure named Employee, with the following members a) Name b) Department c)

 write in c++,pleasee help,i need fast pleaseee (3 marks) Task 1:

Declare a structure named Employee, with the following members a) Name b)

Department c) Basic salary Number of overtimc hours worked in one month

e) 1) Total salary including overtime pay Overtime pay Task 2: Write

a function named readinput (14 marks) a) It receives an array of

write in c++,pleasee help,i need fast pleaseee

(3 marks) Task 1: Declare a structure named Employee, with the following members a) Name b) Department c) Basic salary Number of overtimc hours worked in one month e) 1) Total salary including overtime pay 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 month and name Figure I shows an example of data that can be used to test the program c) Assuming you do not know, the number of employees Calculate the number of employces available in the company based on the number of employee records found in the input file. d) The function should return the number of employees calculated in (e). Production 2500 27 Saiman All Quality 1800 45 Hans Haikat Production 2000 Sahid Abu Production 1800 58 Hallin Hashim Quality 2400 35 Kan laran Engineering 2300 27 Arina Halim Accounting 2500 26 houar Omar Quality 1900 33 Eurken sala Engineering 2 150 52 Bania Hasnan Engineering 2250 14 Buhari Burhan Quality 2250 S CILTA Shar Accounting 2250 16 Amir Arshad Accounting 2130 41 Daud Kasim Engineering 2500 35 Sorian Saad Recounting 2950 29 Alisa eman Figure 1: Sample data in the input file "input.txt" Task 3: Write a function named determinaRate (6 marks) a) It takes the department name as an input parameter b) The function should retum an overtime rate based on the information given in Table 1 2 Department Quality Production Accounting Engineering Table 1 Overtime Rate (RM per hour) I15 100 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 formula for calculating monthly overtime (OT) pay and monthly salary is as follows: Monthly overtime (OT) pay - Overtime me * 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. BASIC (RM) OTROUR) OT PAY (R) SALARY) DEPARTME NAME 27 45 Salman Al Hani Haikal Rashid Abu Hali Hanhin Hani Imron Arina Haxim Anuat Omar Zarith aid Rania Hassan Buhari Burhan Citra Shari Ani Ahad Daud Kasim Sofian Saad Alisman Production Quality Production Production Quality Engineering Accounting Quality Engineering Engineering Quality Accounting Accounting Engineering Accounting 2500.00 80000 700000 1900.00 2400.00 2300 100 2.500.00 190000 2350.00 2250.00 2250 00 2250100 21 80.00 2500.00 245000 33 $2 44 UB 36 61 270.00 317.30 53000 560.00 40215 405.00 450100 379.50 780.00 66000 437.00 450.00 512 50 525.00 362.50 2770.00 2317 50 253000 230000 2802.50 2109.00 2050.00 2279.50 3130.00 2910.00 2687.00 2700.00 2692.50 3029.00 2812.50 29 Figure 2: Expected output for Task 4 Task 5: Writen function named display Analysis (17 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 departments' names, total monthly overtime (OT) pays, and total monthly salary. d) Figure 3 shows an example of the output that will be displayed on the screen based on the data in the input file "anput.txt" shown in Figure 1. 3 DEPARTMENT Production Quality Engineering Accounting TOT OT PAYO 1180.00 1736.50 2370.00 1775.00 T. SALARY (3) 7680.00 10086.50 11770.00 11159.00 Figure 3: Expected output for Task 5 Task 6: Write a main function to perform the following tasks: (5 marks) a) Declare one-dimensional array variable with 50 elements for a structure type Employee 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. Note: 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. SAME DEPARTMENT BASIC I OT CHOUR) OT PAY (FM) SALARY (RM Salman Ali Hanar Haikal Rashid Abu Halim Ilahim Hani Imran Arina Halim Anuar Omar Zarith Laid Rania Hassan Buhari Burhan Citra Shar Amit Arshad Daud Yasin Sorian Saad Alina Azman Production Quality Production Production Quality Engineering Accounting Quality Engineering Engineering Quality Accounting Accounting Engineering Accounting 2500.00 1800.00 2000.00 2800.00 2400.00 2300.00 2500.00 1900.00 2350.00 2250.00 2250.00 223000 218000 2300.00 2450.00 27 45 53 50 35 27 36 33 52 44 20 36 41 35 29 270.00 517.50 530.00 580.00 408.30 405.00 450.00 379 50 780.00 66000 437.00 450.00 512.50 25.00 36250 2770.00 2017.50 2530.00 2380.00 2802.50 2705.00 2950.00 2279.50 3130.00 2910.00 269.00 2700.00 2692.50 1025.00 2812.50 DEPARTMENT Production Quality Engineering Accounting TOT OT FAY (FR) 1380.00 1736.50 23000 175.00 TOT. ALARY (RM) 7600.00 100HG. SO 11270.00 11155.00 Figure 4: Complete output for the data from the input file "input.txt" Task 7: List all function prototypes (4 marks) (5 marks) Task 8: You must ensure your program fulfill the following criteria a) The program is able to run. b) All required hender files are 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!