Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void overTimeWithoutIf(){
- double hours;
- double wage;
- double totalNoOT;
- double totalWithOT;
- double realValue;
- Scanner in = new Scanner(System.in);
- //Input information from user
- System.out.println("What were your hours?");
- hours = in.nextDouble();
- System.out.println("What is your hourly wage?");
- wage = in.nextDouble();
- //Calculate total without and with overtime
- totalNoOT = hours*wage;
- totalWithOT = 40*wage + ((hours-40) *wage*1.5);
- realValue = Math.max(totalNoOT,totalWithOT);
- System.out.println("Your total payment for this week is: $" + realValue);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement