Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write in c++ i need fasttt please Dr i need Fastt Task 7: List all function prototypes. Task 8: You must ensure your program

image text in transcribed

please write in c++ i need fasttt

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

please Dr i need Fastt

Task 7: List all function prototypes. Task 8: You must ensure your program fulfill the following criteria: a) The program is able to run. b) All required header files are included. (3 marks) Task 1: Declare a structure named Employee, with the following members: a) Name b) Department c) Basic salary d) Number of overtime hours worked in one month e) Overtime pay D) Total salary including overtime pay Task 2: Write a function named road Input (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 1 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 employees 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 (c) Production 2500 27 Balman Quality 1800 45 lanir Haikal Production 2000 53 Rashid Abu Production 1800 se alim Hashim Quality 2400 3 tani Imran Engineering 2300 27 Arina Haxim Accounting 2.500 36 Anuat Orat Quality 1900 33 Zarith Ead Engineering 2350 52 Hansa Hassan Engineering 223044 Ruhar Buxhan Quality 2250 38 Citra Shari Accounting 2250 36 Air Arshad Accounting 2100 41 Daud Kanin Engineering 2500 35 Sofian naad Accounting 2450 29 Al Amin Task 3: Write a function named determine Rate (6 marks) a) It takes the department name as an input parameter b) The function should return an overtime rate based on the information given in Table 1 2 Department Quality Production Accounting Engineering Table 1 Overtime Rate (RM per hour) 11.5 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 formula for calculating monthly overtime (OT) pay and monthly salary is as follows: Monthly overtime (On) pay = 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. TANE DEPARTMENT BASIC OT INOUR) OT TAYO SALARY 27 45 53 50 23 Salman Ali Hanit Haikal Rashid Abu Halim Hashim Hans Iman Mina Nam Ana Omar Zarith Eaid Hania Hassan Buhari tuhan Citra Shar Mit Arshad Daud Yani Sotiansand Alisa Arman Production Quality Production Production Quality Engineering Accounting Quality Engineering Engineering Quality Accounting Accounting Engineering Accounting 2500.00 1800.00 200000 1800 00 7400.00 2300 00 250000 1900100 7350 OD 2250 00 2250.00 2250.00 2180.00 2 500 00 2450 00 270.00 517 50 530.00 500.00 402.50 405 00 450.00 379 90 780.00 660.00 437 00 450.00 512.50 3 57 44 2770.00 217 50 2530.00 2180 DO 2002.50 2703.00 2950.00 2279.50 11100 2910.00 2687 00 2700.00 2692.50 3025.00 2012 30 16 15 362.50 Figure 2: Expected output for Task 4 Task 5: Write a function named displayAnalysis (17 marks) a) This is a non-refuming function b) It takes an array of Employee of type atruct 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 "input, txt" shown in Figure 1 3 DEPANTHET Production Quality Engineering Accounting TOT 01 VAR 138000 1736.50 2.170.00 1775.00 TOT SALAXY NEBO CO 10086.50 1177000 11155.00 Figure 3: Expected output for Task 5 Tusk 6: Write a main function to perform the following tasks: (5 marks) a) Declare one-dimensional array variable with 50 clements 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 BASICRH) OT PAYO NA DEPARTMENT OT HOUR) SALARY (RMI 45 53 50 22 30 batman ALL Hanif atkal Rashid At Halin lashim lani Thean Arina Hakim Anuar a Larith and Rania Hassan Buhari turhan citra Shari Amir Arshad Daud Kasim Botian Saad Ali Azan 270.00 517.30 $30.00 500.00 402.30 405.00 450.00 379.50 780,00 660.00 437.00 450.00 512.50 525.00 362.50 Production 3500.00 Quality 1800.00 Production 2000.00 Production 1800.00 Quality 2400.00 Engineering 2.300.00 Accounting 2500.00 Quality 1900.00 Engineering 2350.00 Engineering 2250.00 Quality 2250.00 Accounting 2250.00 Accounting 2180.00 Engineering 2500.00 Accounting 2450.00 TOTOT TAY RHO 1300.00 1936.50 270.00 1775.00 2270.00 2317.50 2530.00 230,00 2002:50 2703.00 350.00 BE7950 310.00 2910.00 07.00 2700.00 2692130 SOS 52 44 36 01 35 20 DEPARTMENT Production Quality Engineering Accounting TOT. SALARY RH) 7600.00 10016:30 1170.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 header files are included

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions