Question: Implement a function payroll ( ) that takes two string parameters the first of which represents the name of an input file and the second
Implement a function payroll that takes two string parameters the first of which represents the
name of an input file and the second of which represents the name of an output file. The input file
contains lines with the following format: hours payrate where hours is an integer representing a
number of hours worked and payrate is a floating point value representing the pay rate per
hour. There will be some whitespace between the two values, although you may not make any
assumptions about how much or what type. The function reads the input file line by line, computing
the total pay ie the product of the hours times the payrate we are not assuming overtime is
computed for any of the values and writing each amount to a newline in the output file. If the file is
empty, the function should not write any numbers to the output file. Note that the strings read from
the file will need to be evaluated before you can use them for computations. The following shows
what the function would return when called on several sample files found in the zip file containing
the assignment template. The output files produced are also in the zip file:
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
