Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pkg;
- import java.util.*;
- public class Salary {
- /* Hamsheed */
- public static void main(String[] args) {
- double hourlyRate, regularHours, overtime;
- Scanner input = new Scanner(System.in);
- System.out.print("Enter Hourly Rate: ");
- hourlyRate = input.nextDouble();
- System.out.print("Enter Regular Hours: ");
- regularHours = input.nextDouble();
- System.out.print("Enter Overtime Hours: ");
- overtime = input.nextDouble();
- double overtimepay = calcOvertimePay(hourlyRate, regularHours, overtime);
- System.out.println("The overtime pay is " + overtimepay);
- }
- public static double calcOvertimePay(double h, double r, double o){
- return ((r * h) + o )* (1.5 * h);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement