Question
This program will be to assist a payroll clerk calculate average salaries and average pay for various types of workers. Most universities have different categories
This program will be to assist a payroll clerk calculate average salaries and average pay for various types of workers. Most universities have different categories of workers with different methods for calculating the employees pay for each category. Our example university has three types of employees: Staff, Faculty, and Hourly. Staff has two subtypes - Administrator and Staff. Faculty has three subtypes - Regular faculty, Adjunct faculty, and Teaching assistants. Staff receive an annual salary paid every month in 12 equal paychecks. Staff can work overtime at rate of 150% of their normal salary but are limited to 10 hours per month of overtime. Administrators receive an annual salary paid equally over 12 months like staff, but administrators receive no overtime. Hourly workers receive a fixed hourly wage for the first 20 hours and 125% of their hourly wage for overtime above the 20 hours. Hourly workers can work at most 40 hours per week. Regular faculty are paid their regular salary over 10 months. Regular faculty have no overtime. However, regular faculty can teach one or more overload classes for an additional $8500 per 3 credit hour course per semester. Page of 1 3 Spring 20222 C291
Adjunct faculty are paid $8500 over 5 months for each 3 credit hour course they teach. For example if an adjunct teaches two courses in one semester, the adjunct will receive $17,000 over 5 months. Adjuncts can teach a maximum of 9 credit hours per semester. Teaching assistants are paid $2500 per course and works 10 hours per week. A TA is allowed to work 2 hours per week overtime at the normal pay rate, i.e. no bonus for overtime. You can assume: 40 hours per week 4 weeks per month All data entry is for the current month which is during a semester, i.e. faculty are getting paid for the current month. Your program needs to first allow the payroll clerk to enter monthly payroll information and then print average weekly and monthly salary for each employee type as well as the average pay for each employee type. NOTE: overtime pay and course overloads are not part of an employees salary but is part of an employees pay. The clerk will need to first be able to enter payroll information for the month. Once all the information is entered, the clerk should be able to quit the program at which time the reports should be printed. The clerk expects to enter the information in the following format. The actual information entered is in blue and the comment is NOT entered by the clerk and is for your information. The clerk should be able to enter data for multiple people, though note that the program does NOT differentiate or track each person. You only need to report on averages. A 100000 /* An administrator make 100K per year */ S 40000 8 /* Staff with 40K salary and worked 8 hours overtime this month */ R 80000 4.5 /* Regular faculty salary 80K with 4.5 credits of overload */ J 6 /* Adjunct is teaching 6 credit hours this semester */ T 2 50 /* TA is teaching two courses and worked a total of 50 hours this month */ H 10 100 /* Hourly works for $10 per hour and worked 100 hours this month */ Any overtime exceeding the maximum allowed should be discounted for all calculations, but a warning should be generated indicating the amount of overtime ignored. You should provide some instructions to remind the clerk of the entry formats. You should provide a way for the clerk to signal that all the data entry is complete, Q. Use the pay codes A, S, R, J, T, and H. You might consider accepting a ? to allow the user to display the instructions. You should define constants for all the fixed values in your program. You should use variables with descriptive names though abbreviations are fine. Be sure to test your program with a wide variety of example data. Ultimately, you want your tests to execute every instruction in your program. Page of 2 3 Spring 20222 C291
Programming Restrictions 1. You can use for and while loops in this program, but you cannot nest two for or two while loops sequentially in a block. So for ( int i = 10; i > 0; i-- ) { for ( int x = 10; x > 0; i-- ) {...}} or while ( i != 10 ) { while ( x == 1 ) { ... }} are NOT allowed but for ( int i = 10; i > 0; i--) { while ( x == 10 ) { for ( int y = 0; y or while ( i != 10 ) { for ( int x = 10; x > 0; i-- ) { while( y are allowed. 2. You must use a switch statement in your code to determine the proper action based on the payroll code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started