Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions 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.
expand button
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
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education