Question: I will walk you through the steps: 1 . Write a program to read through the agreed - hours.txt file and determine the distribution of
I will walk you through the steps:
Write a program to read through the agreedhours.txt file and determine the distribution of Agreed Hours for all courses prefixed with ICT. The file shortagreedhours.txt should not be used in the submission, but you may investigate this file to understand the problem better. Your program must include the following:
All rows starting with ICT that have agreed hours, should be included, for example:
CHCRHA C # should not be included as it does not start with ICT.
ICTCBL C # has agreed hours which should be included.
ICTCBLA C # has no agreed hours and should not be included.
You can split strings starting with ICT, by tabs t
Tip:
To split code using tabs:
possible possible.splitt
Accumulate the number of records with the same Agreed Hours
Sort and print each count by frequency.
Print the total of the number of records.
The order of the records printed, with the same frequency, may vary from the example below.
Ensure you have relevant comments in your code to enhance maintainability.
Extract of output for agreedhours.txt:
hours: frequency:
hours: frequency:
hours: frequency:
hours: frequency:
hours: frequency:
hours: frequency:
hours: frequency:
hours: frequency:
hours: frequency:
hours: frequency:
hours: frequency:
hours: frequency:
PYTHON CODE DONT USE CHATGPT OR ANY AI PLEASE INCLUDE COMMENTS ON CODE.
Example: Desired output for shortagreedhours.txt file:
hours: frequency:
hours: frequency:
hours: frequency:
hours: frequency:
hours: frequency:
hours: frequency:
TOTAL NUMBER OF RECORDS:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
