Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Java by PayRate Class ( 17 years ago )
import java.lang.Math;
public class PayRate 
{
char grade;
int normalHrs;
double basicPayPerHr;
double overtimeRate;
int hoursWorked;
double overtimePay, grossPay, normalPay; 
int overtimeHrs;

public PayRate(char grade, int normalHrs, double basicPayPerHr, double overtimeRate)
{
this.grade = grade;
this.normalHrs = normalHrs;
this.basicPayPerHr = basicPayPerHr;
this.overtimeRate = overtimeRate;
this.hoursWorked=hoursWorked;
this.overtimeHrs=overtimeHrs;
}


public double calcPay(int hoursWorked)
{
 if(hoursWorked<=normalHrs)
 {
  normalPay=basicPayPerHr*hoursWorked;
  
 }
 else
 {
  overtimeHrs=hoursWorked-normalHrs;
  overtimePay=overtimeHrs*overtimeRate*basicPayPerHr;
  //overtimePay=Math.round(overtimePay);
  normalPay=basicPayPerHr*(hoursWorked-overtimeHrs);
 }
 grossPay=overtimePay+normalPay; 
  
 return grossPay;
}

public void print()
{
// System.out.println(grossPay);
}

}

 

Revise this Paste

Your Name: Code Language: