3. A method to calculate overtime pay. This method should be called from calculatePay if and when
required.
public static double calculateOverTimePay(int OverTimeHours, double
basePay)
4. A method to display information
public static void displayInfo(String empName, int workingHours, double
totalPay)
/**
* A method to calculate overtime pay. This method should be called from calculatePay if and when required.
* @param OverTimeHours
* @param basePay
* @return
*/
public static double calculateOverTimePay(int OverTimeHours, double basePay) {
return 40 * basePay + ((OverTimeHours) * basePay) * 1.5;
}
/***
* A method to display information
* @param empName
* @param workingHours
* @param totalPay
*/
public static void displayInfo(String empName, int workingHours, double totalPay) {
System.out.println("Employee Name: " + empName);
System.out.println("Employee working hour: " + workingHours);
System.out.println("Employee total pay: " + totalPay);
}
Comments
Leave a comment