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)
{
}

Respuesta :

Answer:

Answer is in the provided screenshot!

Explanation:

Steps required:

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

Ver imagen rainestormee