wiley_pastebin

Classes 3

Mar 18th, 2019
2,915
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. public class Contract {
  2.  private int totalCost;
  3.  private int hoursLeft;
  4.  private String employer;
  5.  private static int hourlyRate;  
  6.  
  7.  public Contract(String employer, int hours){
  8.   this.employer = employer;
  9.   this.hoursLeft = hours;
  10.   this.totalCost = Contract.hourlyRate * hours;
  11.  }
  12.  //...
  13.  
  14.  public static void changeRate(int newRate){
  15.   Contract.hourlyRate = newRate;
  16.  }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment