Question: ICS - 1 4 1 : Problem Solving with Java Lab 3 : Weekly Wage Calculator Due Date: 0 1 / 2 5 / 2
ICS: Problem Solving with Java
Lab : Weekly Wage Calculator
Due Date:
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 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 $ an hour. If an
hourly employee works over hours during the week, the extra hours ie total number of
hours hours is paid at oneandhalf times the regular hourly rate.
Write a program in Java to calculate an employees weekly pay. The program does the
following:
Prompts the user to enter the employees name.
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.
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.
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
it calculates the regular weekly wage. If the total hours for the week is exceeds then
the program calculate weekly pay to include the extra overtime pay.
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
