115k views
1 vote
JAVA

Write a method that takes in two numbers that represent hours worked and hourly pay. The function should return the total amount paid for the hours entered. For any hours over 40, you should receive overtime pay, which is 1.5 times the regular pay.

Example:

payday(50, 10.00) --> 550.0
payday(20, 5.00) --> 100.0

public static double payDay(int hours, double pay)
{
}

User Endrias
by
7.0k points

1 Answer

5 votes

Answer:

Answer is in the provided screenshot!

Step-by-step explanation:

Steps required:

check if pay is greater than 40, if so then handle logic for pay over 40, else treat normally.

JAVA Write a method that takes in two numbers that represent hours worked and hourly-example-1
User Griselle
by
6.9k points