Hi I cannot figure out why my program won't calculate the overtime pay correctly. Overtime is supposed to be hours worked over 40 paid at 2.5. Can someone please tell me what I am missing?
import java.util.Scanner; public class If { public static void main(String[] args) { Scanner input = new Scanner(System.in); // TODO Auto-generated method stub float payRate; float timehours; float pay; System.out.println("Enter payrate per hour: "); payRate = input.nextFloat(); System.out.println("How many hours did you work?: "); timehours= input.nextFloat(); if(timehours> 40) { pay = (float) (payRate*40+2.5*timehours); //over time pay is calculated } else timehours <= 40 { pay= payRate*timehours; } System.out.println("Your weekly pay is " + pay); }//end of main //end of class }