Question: Consider that there are multiple text files, each named with a unique department code in the format DEPARTMENT _ CODE.txt . DEPARTMENT _ CODE

Consider that there are multiple text files, each named with a unique department code in the format "DEPARTMENT_CODE.txt". DEPARTMENT_CODE is a unique identifier for each department, for example, HR001, FIN002, etc.
Each file contains data structured as follows:
Quarter 1 Revenue (25%) Quarter 2 Revenue (25%) Quarter 3 Revenue (25%) Quarter 4 Revenue (25%) Employee ID
20000.0022000.0021000.0023000.00 e12345
18000.0025000.0020000.0024000.00 e23456
21000.0023000.0022000.0021000.00 e34567
Each line represents revenue contributions from Quarter 1 out of 25, Quarter 2 out of 25, Quarter 3 out of 25, and Quarter 4 out of 25 for a specific employee ID. Each file contains the revenue contributions for a specific department.
Write a program to:
1. Load all the files and process them to calculate the average revenue contributions for Quarter 1, Quarter 2, Quarter 3, and Quarter 4 for each department. Save the result in a file named "DEPARTMENT_CODE_avg.txt".
2. Determine the number of employees who did not meet the annual revenue target (assuming a total annual revenue threshold of $80,000, combining all four quarters). Save the result in a file named "DEPARTMENT_CODE_failed.txt".

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 Programming Questions!