

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The instructions for lab 3 of cs 2073 at utsa, where students are required to write a program to calculate the weekly pay for different types of employees based on their paycodes. The objectives, hand-in requirements, details, setup, and coding process.
Typology: Lab Reports
1 / 2
This page cannot be seen from the preview
Don't miss anything!


All laboratories will be submitted electronically through WebCT. Zip up your entire project folder to submit as the source. (Right click on the laboratory folder and follow the SentTo link.)
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 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 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. Use a switch to compute each employee’s pay based on that employee’s paycode. Within the switch, prompt the user (i.e., the payroll clerk) to enter the appropriate facts your program needs to calculate each employee’s pay based on that employee’s paycode.
int payCode; /* current employee’s pay code / int managers = 0; / total number of managers / int hWorkers = 0; / total number of hourly workers / int cWorkers = 0; / total number of commission workers */
int pWorkers = 0; /* total number of pieceworkers / int pieces; / current pieceworkder’s number of pieces / double mSalary; / manager’s salary / double hSalray; / hourly worker’s salary / double cSalary; / commission worker’s salary / double pSalary; / pieceworker’s salary / double hours; / total hours worked / double otPay; / overtime pay / double otHours; / overtime hours / double pay; / current employee’s weekly pay */
Compile and run your program until there are no errors. You may test your program at least once on each case.