wiley_pastebin

Classes 1

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