
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
eqowleuoe;iqieipqeiqieoqp
Python please.

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
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
- Attach File Browse My Computer QUESTION 6 A. Simplify the following expression by using the laws of logic. Suppose the bit strings of A & B are A: 0100001010, B: 0100111011. Find the bit strings of ANB AUB Attach File Browse My Computer BAAAarrow_forwardTRUE OR FALSE // C PROGRAMMING LANGUAGE When a file opened for writing already exist its contents would be over writtenarrow_forwardIn C++, how do you encrypt one character in a file read into the code?arrow_forward
- fast in python thanksarrow_forwardFull Implementation (user input in red) Welcome to the Caesar Cipher This program encrypts and decrypts text using Caesar Cipher. Would you like to encrypt (e) or decrypt (d): d Would you like to read from a file (f) or the console (c)? c What message would you like to decrypt: LIPPS ASVPH What is the shift number: 4 HELLO WORLD Would you like to encrypt or decrypt another message? (y/n): y Would you like to encrypt (e) or decrypt (d): e Would you like to rea from a file (f) or the console What message would you like to encrypt: Hello World What is the shift number: 4 (c) ? c LIPPS ASVPH Would you like to encrypt or decrypt another message? (y/n): y Would you like to encrypt (e) or decrypt (d): e Would you like to read from a file (f) or the console (c) ? f Enter a filename: something_silly.txt Invalid Filename Enter a filename: messages.txt What is the shift number: 4 6 Output written to results.txt Would you like to encrypt or decrypt another message? (y/n): n Thanks for using the…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education