Question
How do I create a python prorgram that does the following : A company hired 10 temporary workers who are paid hourly and you are
How do I create a python prorgram that does the following :
A company hired 10 temporary workers who are paid hourly and you are given a data file (each students will have to create this file) that contains the name of the employees, the number of hours each employee worked in the week, and the hourly pay rate of each employee. Values on each line are comma separated. You are asked to write a program that computes each employees weekly pay and the average salary of all the workers. The program then outputs the weekly pay of each employee, the average weekly pay, and the names of all the employees whose pay is greater than or equal to the average pay. If the number of hours worked in a week is more than 40 hours, then the pay rate for the hours over 40 is 1.5 times the regular hourly rate.
Your program must contain functions for the following:
A function that reads the data from the file into a list and return the list. This function will take the name of the file as a parameter.
A function that calculates and stores each employees data: name, total hours worked, overtime hours, overtime pay, regular pay, total pay. The list containing the data from the file will be passed to this function as parameter. This function returns a list or dict containing all employees data.
A function that calculates and returns the average pay. This function takes the list or dict containing all employees data.
A function that displays the names of all the employees whose pay is greater than or equal to the average weekly pay. This function takes the list or dict containing all employees data and the average pay. Your program must display the average pay
A function to output each employees data properly formatted on screen. This function takes the list or dict containing all employees data.
When the program begins, the user will be prompted for the name of the data file.
Example data for each line in the data file
Jane Doe,45,18.5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started