Advertisement
476179

wages

Sep 25th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. package lessons;
  2.  
  3. // given an employees pay rate of $25/hour and overtime of $37.50/hour
  4. // write a program to calculate gross pay
  5. //if they work 40 reg hours and 10 overtime
  6.  
  7. public class Wages
  8. {
  9.  
  10. public static void main(String[] args)
  11. {
  12. int totalReg,regPay = 25, regHour = 40, overtimeHour = 10;
  13. float grossPay, totalOver, overtimePay = 37.50f;
  14. totalReg = regPay * regHour;
  15. totalOver = overtimePay * overtimeHour;
  16. grossPay = totalReg + totalOver;
  17. System.out.println("the employees gross pay is: "+grossPay);
  18. }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement