Program a python program that demonstrates reading and comparing Create a python program that demonstrates reading and comparing multiple files, processes the input files based on the business rules, and produces an output file. Needed Files 1. The timeclock.txt Download timeclock.txtfile contains the hours worked data for every employee as well as the shift they worked. The layout for the file is as follows: EMPLOYEE_NUMBER, HOURS_WORKED, SHIFT Timeclock.txt 22476, 45, 3 24987, 30, 1 48283, 50, 2 85437, 25, 3 2. The personnel.txt Download personnel.txtfile contains the names of all employees and their hourly pay rates. The layout for the file is as follows: EMPLOYEE_NUMBER, EMPLOYEE_NAME, PAY_RATE Personnel.txt 11235, Bob Smith, 10.50 22476, John Roberts, 12.35 24987, Mary Johnson, 15.90 32743, Brad Carson, 11.25 48283, Alice Martin, 14.20 85437, Aaron James,15.15 Note: Both the timeclock.txt and payroll.txt files are pre-sorted by EMPLOYEE_NUMBER in ascending order. Business Rules For hours <= 40, the employee gross pay is: HOURS_WORKED * PAY_RATE For hours > 40, the employee gross pay is: HOURS_WORKED * PAY_RATE * 1.5 For shift 3, add $1 per hour to the employee pay rate The program should: Download both input files in the same folder that you will create your .py program. Read both input files together. Match the input files by the EMPLOYEE NUMBER. For each record in the timesheet.txt file, write a record in a new output file named Document your program with appropriate comments. Test your program by comparing your results to this expectedpayroll.txt Download expectedpayroll.txtfile. In general, running one test is not enough. Create at least two additional test runs by altering the timeclock.txt file. After EACH test run, rename the payroll.txt file to payroll1.txt, payroll2.txt, etc. Expectedpayroll.txt 22476, John Roberts, 634.12 24987, Mary Johnson, 477.00 48283, Alice Martin, 781.00 85437, Aaron James, 403.75

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Program a python program that demonstrates reading and comparing

 

Create a python program that demonstrates reading and comparing multiple files, processes the input files based on the business rules, and produces an output file.

Needed Files

 

1. The timeclock.txt Download timeclock.txtfile contains the hours worked data for every employee as   well as the shift they worked. The layout for the file is as follows:
    EMPLOYEE_NUMBER, HOURS_WORKED, SHIFT
Timeclock.txt

22476, 45, 3

24987, 30, 1
48283, 50, 2
85437, 25, 3

 

 

2. The personnel.txt Download personnel.txtfile contains the names of all employees and their hourly pay rates. The layout for the file is as follows:
    EMPLOYEE_NUMBER, EMPLOYEE_NAME, PAY_RATE
Personnel.txt

11235, Bob Smith, 10.50

22476, John Roberts, 12.35
24987, Mary Johnson, 15.90
32743, Brad Carson, 11.25
48283, Alice Martin, 14.20
85437, Aaron James,15.15

Note: Both the timeclock.txt and payroll.txt files are pre-sorted by EMPLOYEE_NUMBER in ascending order. 

Business Rules

  1. For hours <= 40, the employee gross pay is: HOURS_WORKED * PAY_RATE
  2. For hours > 40, the employee gross pay is: HOURS_WORKED * PAY_RATE * 1.5
  3. For shift 3, add $1 per hour to the employee pay rate

The program should:

  1. Download both input files in the same folder that you will create your .py program.
  2. Read both input files together.
  3. Match the input files by the EMPLOYEE NUMBER.
  4. For each record in the timesheet.txt file, write a record in a new output file named
  5. Document your program with appropriate comments.
  6. Test your program by comparing your results to this expectedpayroll.txt Download expectedpayroll.txtfile. In general, running one test is not enough. Create at least two additional test runs by altering the timeclock.txt file. After EACH test run, rename the payroll.txt file to payroll1.txt, payroll2.txt, etc.

Expectedpayroll.txt

22476, John Roberts, 634.12
24987, Mary Johnson, 477.00
48283, Alice Martin, 781.00
85437, Aaron James, 403.75

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY