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.

### Python Payroll Program

This educational module covers writing a Python program (`payroll.py`) that consists of two functions:

- **`main`**
- **`fPayroll`**

#### Function: `main`

The `main` function performs the following tasks:

- Prints a welcome message: "Welcome to the Payroll Manager!"
- Executes five calls to the `fPayroll` function using various employee names, hours worked, and pay rates.
- Aggregates and displays the regular pay and overtime pay for the five function calls.

#### Function: `fPayroll`

The `fPayroll` function handles the following:

- Accepts three parameters: `employee name`, `hours worked`, and `pay rate` in dollars per hour.
- Calculates the employee's salary as the product of hours worked and the pay rate.
- Adds overtime pay if hours worked exceed 40, calculated at 1.5 times the regular pay rate.
- Prints the name, hours worked, pay rate, and total salary.
- Returns both the regular and overtime pay.

#### Test Data and Output

Below is an example of the test data and expected output:

```plaintext
C:\Users\mkcremer>python c:\temp\py\payroll.py
Welcome to the Payroll Manager

Employee: Michael  Hours worked: 38.00  Pay per hour: $18.34  Salary: $696.92
Employee: Mary  Hours worked: 45.20  Pay per hour: $16.92  Salary: $766.21
Employee: Nicole  Hours worked: 50.00  Pay per hour: $23.54  Salary: $1275.16
Employee: Robert  Hours worked: 42.00  Pay per hour: $21.34  Salary: $917.62
Employee: Suzanne  Hours worked: 38.00  Pay per hour: $19.21  Salary: $729.98

Sum Regular Pay: $3813.70
Sum Overtime Pay: $572.19
```

### Explanation of Output

The program first displays a welcome message and then processes each employee’s payroll information, outputting the employee name, hours worked, hourly rate, and total salary including any applicable overtime. At the end, the program sums up the regular and overtime pay separately and displays these totals.
Transcribed Image Text:### Python Payroll Program This educational module covers writing a Python program (`payroll.py`) that consists of two functions: - **`main`** - **`fPayroll`** #### Function: `main` The `main` function performs the following tasks: - Prints a welcome message: "Welcome to the Payroll Manager!" - Executes five calls to the `fPayroll` function using various employee names, hours worked, and pay rates. - Aggregates and displays the regular pay and overtime pay for the five function calls. #### Function: `fPayroll` The `fPayroll` function handles the following: - Accepts three parameters: `employee name`, `hours worked`, and `pay rate` in dollars per hour. - Calculates the employee's salary as the product of hours worked and the pay rate. - Adds overtime pay if hours worked exceed 40, calculated at 1.5 times the regular pay rate. - Prints the name, hours worked, pay rate, and total salary. - Returns both the regular and overtime pay. #### Test Data and Output Below is an example of the test data and expected output: ```plaintext C:\Users\mkcremer>python c:\temp\py\payroll.py Welcome to the Payroll Manager Employee: Michael Hours worked: 38.00 Pay per hour: $18.34 Salary: $696.92 Employee: Mary Hours worked: 45.20 Pay per hour: $16.92 Salary: $766.21 Employee: Nicole Hours worked: 50.00 Pay per hour: $23.54 Salary: $1275.16 Employee: Robert Hours worked: 42.00 Pay per hour: $21.34 Salary: $917.62 Employee: Suzanne Hours worked: 38.00 Pay per hour: $19.21 Salary: $729.98 Sum Regular Pay: $3813.70 Sum Overtime Pay: $572.19 ``` ### Explanation of Output The program first displays a welcome message and then processes each employee’s payroll information, outputting the employee name, hours worked, hourly rate, and total salary including any applicable overtime. At the end, the program sums up the regular and overtime pay separately and displays these totals.
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