Question
PayRoll The rules for overtime pay are as follows: if you work 40 hours or less, there is no overtime pay. The paycheck is just
PayRoll
The rules for overtime pay are as follows: if you work 40 hours or less, there is no overtime pay. The paycheck is just hours*rate.If you work more than 40 yours, then you are paid with a variable rate. The first 40 hours of your paycheck is paid at your base rate. Anything over 40 hours is paid at "time and a half" or, in other words, 1.5*rate.
For example, suppose you work 45 hours and your pay rate is $10/hour. You would earn $400 for the first 40 hours. The next 5 hours would aware you 5*10*1.5 or $75. So your total paycheck would be $475 (rather than $450 if you just multiply hours*rate).
Here is what your program output should look like:
The paycheck is $310.0
The paycheck is $185.0
The paycheck is $687.5
The paycheck is $712.5
can i get help with this java program code
import java.util.Scanner;
//Name: Emma Stavropoulos
//Approximate completion time: 20 mins
//References: The online book
//Assignment 4 Drills
public class PayRoll
{
public static void main (String [] args){
System.out.println("\f");// flush the buffer (erase the screen)
payCheck( 40, 7.75);// answer: $310
payCheck( 20, 9.25);// answer: $185
payCheck( 50, 12.50);// answer: $687.50
// (the first 40 hours are paid at $12.50
//the next 10 hours are at $12.50*1.5)
payCheck( 45, 15.00);// answer: $712.50
}
// your payCheck method here
}
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