Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*in response to comment: no sample input or output was given, this is all the information I have. I've tried writing the pseudocode for it

*in response to comment: no sample input or output was given, this is all the information I have. I've tried writing the pseudocode for it but the switch statements confuse me.

Write the following program in C. Assume a random fixed number for both hourly and weekly (i.e. 8 dollars/hour, $500/week).

Many universities pay their teaching assistants (TA) or associate instructors (AI) as weekly workers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 10 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 7.1 times their gross weekly work hours), or pieceworkers (who receive a fixed amount of money for each of the items they produce - each pieceworker in the university works on only one type of item). Some TAs may be international students who are not authorized to work more than 20 hours per week. Write a program to compute the weekly pay for each worker. You do not know the number of employees in advance. Each type of worker has its own pay code: AIs have paycode W, hourly workers have code H, commission workers have code C and pieceworkers have code P. Use a switch statement to compute each employees pay based on that employees paycode. Within the switch, prompt the user (i.e., the payroll clerk) to enter the number of employees of each paycode (minimum of 2), and the appropriate facts your program needs to calculate each employees pay based on that employees paycode. [Note: You can input values of type double using the conversion specifier %lf with scanf.]. The program should start by displaying a Menu like option where you user can enter the appropriate paycode first along with the number of employees of that type. Only acceptable paycodes are W, H, C, and P. User may enter Q to quit the program. Any other choice should display the menu again. Also display the following statistics: Weekly salary paid to workers who are international students, Weekly salary paid to workers who are domestic students, Weekly salary paid to workers with different paycodes. Total weekly salary paid to all workers Note 1: Loops can be written using while, for and do-while statements. For this question, you cant use same loop statement more than once (For example: if you have to use double nested loop, you cant use for loop inside a for loop. It has to be for loop inside a while or vice versa or some other combination)! Note 2: Your program should be case insensitive. Uppercase and lowercase inputs will be considered correct! Note 3: After displaying the salary amounts, show the menu again automatically. Notice that there will be no other way to stop the program until user enters Q.

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

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

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions