Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q1: A company pays its employees as managers (who receive a fixed weekly salary), ho urly workers (who receive a fixed hourly wage for up

image text in transcribed

Q1: A company pays its employees as managers (who receive a fixed weekly salary), ho urly workers (who receive a fixed hourly wage for up to the first 40 hours they work and time and a half"1.5 times their hourly wage for overtime hours worked), commission workers (who receive $250 plus 5.7 percent oftheir gross weekly sales), or pieceworkers (who receive a fixed amount of money per item for each of the items they produce each pieceworker in this company works on only one type of item) Write a program to compute the weekly pay for each employee. You do not know the number of employees in advance. Each type of emplo yee has its own pay code: Managers have code 1, hourly workers have code 2, commission workers have code 3 and pieceworkers have code 4. Use a switch to compute each employee's pay according to that employee's payco de. Within the switch, prompt the user (ie., the payroll clerk) to enter the appropriate facts your program needs to calculate each employee's pay accor ding to that employee's payco de. Sample output is provided next. Model your code to produce these results Enter paycode (-1 to end) 1 Manager selected Enter weekly salary: 1000 Commission Worker's pay is $1000.00 Enter paycode (-1 to end): 3 Commission worker selected Enter gross weekly sales: 4000 Commission Worker's pay is $478.00 Enter paycode (-1 to end): 2 Hourly worker selected Enter the hourly salary: 4.50 Enter the total hours worked: 20 Worker's pay is $90.00 Enter paycode (-1 to end): 4 Pieceworker selected. Enter number of pieces: 50 Enter wage per piece: 3 Pieceworker's pay is $150.00 Enter paycode (-1 to end) 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions