In this problem, you need to calculate someone's pay by multiplying their salary (double)by the hours (int) worked. If they worked for more than 8 hours, you pay them 1.5 times their salary for however many hours more they worked. Here is my solution.
public static double pay(double a, int b) {
if (b > 8) {
return (a * 8) + ((b - 8)*(a * 1.5));
}
else {
return (a * b);
}}
Wondering if there is any way to do it without if else statements since the course hasn't taught those yet.