Question
An employee is paid at a rate of $18.28 per hour for the first 40 hours worked in a week. Any hours over that are
An employee is paid at a rate of $18.28 per hour for the first 40 hours worked in a week. Any hours over that are paid at the overtime rate of one and a half times that. From the worker's gross pay, 6% is withheld for social security tax, 13% is withheld for federal income tax, 5% is withheld for state income tax, and $11 per week is withheld for union dues. If the worker has two or more dependents, then an additional $35 is withheld each week to cover the extra cost of health insurance beyond what the employer pays.
Remember: Use variables or named constants to store all numbers so that they can be changed later on if necessary. Do not repeat calculations unnecessarily! Test your program with different values for the variables to make sure it works in all scenarios!
Write a program in JAVA that stores the number of hours worked in a week and the number of dependants and then will output the worker's gross pay, each withholding amount, and the net take-home pay for the week.
Ask the user for the number of hours worked in a week and the number of dependents as input, and then print out the same information as in Part 1. Perform input validation to make sure the numbers entered by the user are reasonable (non-negative, not unusually large, etc).
Let the calculations repeat until the user wishes to quit the program.
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