Question: ICS - 1 4 1 : Problem Solving with Java Lab 3 : Weekly Wage Calculator Due Date: 0 1 / 2 5 / 2

ICS-141: Problem Solving with Java
Lab 3: Weekly Wage Calculator
Due Date: 01/25/2024
During the lecture we studied how selection statements are implemented in Java. This exercise
tests our understanding and the application of the selection statements.
Problem:
Supposing a company has two types of employees, which includes salary workers and hourly
wage workers, and both types of employees are paid weekly. For the salary workers, their
weekly pay is calculated by dividing their annual salary by 52. In the case of the hourly
employees, their weekly pay is determined by the number of hours they worked for the
duration of the week. The regular hourly pay for the hourly workers is $25.00 an hour. If an
hourly employee works over 40 hours during the week, the extra hours (i.e. total number of
hours 40 hours) is paid at one-and-half times the regular hourly rate.
Write a program in Java to calculate an employees weekly pay. The program does the
following:
1. Prompts the user to enter the employees name.
2. Prompts the user to enter employee type: either S for salary employee or H for
hourly employee. The program can also accept the lower case s or h at the prompt.
3. If the user enters S or s, the program would prompt the user to enter the annual
salary for the worker, and then calculate the weekly pay.
4. If the user enters H or h, the program prompts the user to enter the number of
hours accumulated for the week. If the total number of hours is less than or equal to 40,
it calculates the regular weekly wage. If the total hours for the week is exceeds 40, then
the program calculate weekly pay to include the extra overtime pay.
5. The program displays the employees name, and the type of wage, and the weekly pay.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!