Write a Python program (payroll.py) that consists of two functions: ➤ main ➤ fPayroll In function main do the following: > Print a message that says "Welcome to the Payroll Manager!" ▸ Perform five calls to the fPayroll function with various names, hours worked, and pay rates (see output below) ► Aggregate the regular pay and overtime pay over the five function calls and display them below the previous output (see output below) In function fPayroll do the following: ➤ Define three parameters: employee name, hours worked that week, and pay rate in dollars per hour > Calculate the employee's salary as the number of hours worked multiplied by the pay rate ➤ If the employee has worked more than 40 hours, then calculate overtime as 1.5 times the regular pay rate and add that to the salary (total salary) Print the name, hours worked, pay rate and the total salary as shown below in the output Return the regular pay and the overtime pay

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

eqowleuoe;iqieipqeiqieoqp

Python please.

Write a Python program (payroll.py) that consists of two functions:
➤ main
➤ fPayroll
In function main do the following:
> Print a message that says "Welcome to the Payroll Manager!"
▸ Perform five calls to the fPayroll function with various names, hours worked, and pay rates (see output
below)
► Aggregate the regular pay and overtime pay over the five function calls and display them below the
previous output (see output below)
In function fPayroll do the following:
➤ Define three parameters: employee name, hours worked that week, and pay rate in dollars per hour
> Calculate the employee's salary as the number of hours worked multiplied by the pay rate
➤ If the employee has worked more than 40 hours, then calculate overtime as 1.5 times the regular pay rate
and add that to the salary (total salary)
Print the name, hours worked, pay rate and the total salary as shown below in the output
Return the regular pay and the overtime pay
Use the test data as shown in the following output:
Command Prompt
C:\Users\mckremer>python c:\temp\py\payroll.py
Welcome to the Payroll Manager
Employee: Michael
Employee: Mary
Employee: Nicole
Employee: Robert
Employee: Suzanne
Hours worked: 38.00
Hours worked: 45.50
Hours worked: 51.20
Hours worked: 42.00
Hours worked: 38.00
Sum Regular Pay: $3813.70
Sum Overtime Pay: $572.19
Pay per hour: $18.34
Pay per hour: $15.88
Pay per hour: $22.45
Pay per hour: $21.34
Pay per hour: $19.21
Salary: $696.92
Salary: $766.21
Salary: $1275.16
Salary: $917.62
Salary: $729.98
X
Transcribed Image Text:Write a Python program (payroll.py) that consists of two functions: ➤ main ➤ fPayroll In function main do the following: > Print a message that says "Welcome to the Payroll Manager!" ▸ Perform five calls to the fPayroll function with various names, hours worked, and pay rates (see output below) ► Aggregate the regular pay and overtime pay over the five function calls and display them below the previous output (see output below) In function fPayroll do the following: ➤ Define three parameters: employee name, hours worked that week, and pay rate in dollars per hour > Calculate the employee's salary as the number of hours worked multiplied by the pay rate ➤ If the employee has worked more than 40 hours, then calculate overtime as 1.5 times the regular pay rate and add that to the salary (total salary) Print the name, hours worked, pay rate and the total salary as shown below in the output Return the regular pay and the overtime pay Use the test data as shown in the following output: Command Prompt C:\Users\mckremer>python c:\temp\py\payroll.py Welcome to the Payroll Manager Employee: Michael Employee: Mary Employee: Nicole Employee: Robert Employee: Suzanne Hours worked: 38.00 Hours worked: 45.50 Hours worked: 51.20 Hours worked: 42.00 Hours worked: 38.00 Sum Regular Pay: $3813.70 Sum Overtime Pay: $572.19 Pay per hour: $18.34 Pay per hour: $15.88 Pay per hour: $22.45 Pay per hour: $21.34 Pay per hour: $19.21 Salary: $696.92 Salary: $766.21 Salary: $1275.16 Salary: $917.62 Salary: $729.98 X
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Concept of Parenthesis
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education