Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

for Python 3 Prompt the user how many employees will be entered -take input for an employee, prompt the user for a name, hours worked,

for Python 3

Prompt the user how many employees will be entered

-take input for an employee, prompt the user for a name, hours worked, and hourly rate. If the employee works over 40 hours, they should receive 1.5 times their hourly rate for all hours worked over 40. Print the employee name and the amount the employee should be paid. Display the payment amount with two digits after the decimal place and commas.

Use a looping structure to get input (a string and two float) and print output for the number of employees the user enters for the first prompt. Calculate the cumulative total to be paid for employees entered. Calculate the average pay for the employees entered. Print both results.

Sample Run:

How many employees do you want to enter? 3

Enter a name: Mike

Enter hours worked: 42.5

Enter hourly rate: 285.11

Mike should be paid $12,473.56

Enter a name: Stephen

Enter hours worked: 45

Enter hourly rate: 294

Stephen should be paid $13,965.00

Enter a name: Lee

Enter hours worked: 51

Enter hourly rate: 268

Lee should be paid $15,142.00

The total amount to be paid is $41,50.56

The average employee is paid $13,860.19

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions