Advertisement
duc-phan

Untitled

Nov 30th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. public Money calculatePay(Employee e) throws InvalidEmployeeType {
  2.         switch (e.type) {
  3.             case COMMISSIONED:
  4.                 return calculateCommissionedPay(e);
  5.             case HOURLY:
  6.                 return calculateHourlyPay(e);
  7.             case SALARIED:
  8.                 return calculateSalariedPay(e);
  9.             default:
  10.                 throw new InvalidEmployeeType(e.type);
  11.         }
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement