Exercise 5.1 (pay.py). A company pays its employees as managers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 40 hours they work and "time-and-a-half"- i.e., 1.5 times their hourly wage for overtime hours worked), commission workers (who receive $250 plus 5.7% of their gross weekly sales), or pieceworkers (who receive a fixed amount of money for each of the items that they produce-each pieceworker within this company works on only one item type). Write a program that computes the weekly pay for each employee. Each type of employee has its own pay code: Managers have paycode 1, hourly workers have code 2, commission workers have code 3, and pieceworkers have code 4. The output of the program should look as follows: $python3 pay-py > Enter the type of employee:: 3 (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 1 * Enter weekly salary: 1200 5 The manager's pay is 1200 ⚫ $python3 pay-py 7 Enter the type of employee:: ■ (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 3 Enter gross weekly sales: 65 The commision worker's pay is 253.70 $python3 pay.py 12 Enter the type of employee:: 13 (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 2 Enter the hourly salary: 12 15 Enter the total hours worked: 45 The worker's pay is 570.00 17$python3 pay.py Enter the type of employee:: (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 4 Enter number of peices made: 65 Enter the wage per peice: 12 The peice worker's pay is 780.00 $python3 pay.py Enter the type of employee:: (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): -1 × Error, the given employee code is not valid. Valid codes are: » 1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker $python3 pay-py Enter the type of employee:: (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 5 Error, the given employee code is not valid. Valid codes are: 1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

Code must follow Pep8 guidelines

Exercise 5.1 (pay.py).
A company pays its employees as managers (who receive a fixed weekly salary), hourly workers
(who receive a fixed hourly wage for up to the first 40 hours they work and "time-and-a-half"-
i.e., 1.5 times their hourly wage for overtime hours worked), commission workers (who receive
$250 plus 5.7% of their gross weekly sales), or pieceworkers (who receive a fixed amount of
money for each of the items that they produce-each pieceworker within this company works
on only one item type). Write a program that computes the weekly pay for each employee.
Each type of employee has its own pay code: Managers have paycode 1, hourly workers have
code 2, commission workers have code 3, and pieceworkers have code 4.
The output of the program should look as follows:
Transcribed Image Text:Exercise 5.1 (pay.py). A company pays its employees as managers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 40 hours they work and "time-and-a-half"- i.e., 1.5 times their hourly wage for overtime hours worked), commission workers (who receive $250 plus 5.7% of their gross weekly sales), or pieceworkers (who receive a fixed amount of money for each of the items that they produce-each pieceworker within this company works on only one item type). Write a program that computes the weekly pay for each employee. Each type of employee has its own pay code: Managers have paycode 1, hourly workers have code 2, commission workers have code 3, and pieceworkers have code 4. The output of the program should look as follows:
$python3 pay-py
> Enter the type of employee::
3 (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 1
* Enter weekly salary: 1200
5 The manager's pay is 1200
⚫ $python3 pay-py
7 Enter the type of employee::
■ (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 3
Enter gross weekly sales: 65
The commision worker's pay is 253.70
$python3 pay.py
12 Enter the type of employee::
13 (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 2
Enter the hourly salary: 12
15 Enter the total hours worked: 45
The worker's pay is 570.00
17$python3 pay.py
Enter the type of employee::
(1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 4
Enter number of peices made: 65
Enter the wage per peice: 12
The peice worker's pay is 780.00
$python3 pay.py
Enter the type of employee::
(1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): -1
× Error, the given employee code is not valid.
Valid codes are:
» 1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker
$python3 pay-py
Enter the type of employee::
(1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 5
Error, the given employee code is not valid.
Valid codes are:
1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker
Transcribed Image Text:$python3 pay-py > Enter the type of employee:: 3 (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 1 * Enter weekly salary: 1200 5 The manager's pay is 1200 ⚫ $python3 pay-py 7 Enter the type of employee:: ■ (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 3 Enter gross weekly sales: 65 The commision worker's pay is 253.70 $python3 pay.py 12 Enter the type of employee:: 13 (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 2 Enter the hourly salary: 12 15 Enter the total hours worked: 45 The worker's pay is 570.00 17$python3 pay.py Enter the type of employee:: (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 4 Enter number of peices made: 65 Enter the wage per peice: 12 The peice worker's pay is 780.00 $python3 pay.py Enter the type of employee:: (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): -1 × Error, the given employee code is not valid. Valid codes are: » 1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker $python3 pay-py Enter the type of employee:: (1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker): 5 Error, the given employee code is not valid. Valid codes are: 1: Manager; 2: Hourly worker; 3: Commission Worker; 4: Pieceworker
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole