class Farm

{
  /* Contains data for a farm */
  private String farmerName;
  private int    numberOfCows;
  private int    numberOfPigs;
  private int    balesOfHay;

  /*
    This is a default constructor. Note that the 'F' is upper case to agree 
    with the 'F' of the class Farm. It is the class not the filename which 
    is important.
  */

  Farm ( )
  {
  }


  //This is a another constructor.

  Farm (String farmer )
  {
    farmerName = farmer;
  }
  
  public void setFarmerName(String farmer)
  {
    farmerName = farmer;
  }

  public String getFarmerName()
  {
    return (farmerName);
  }

  // Cow methods
  
  public void setNumCows(int cows)
  {
    numberOfCows = cows;
  }

  public void addSomeCows(int cows)
  {
    numberOfCows = numberOfCows+cows;
  }

  public void sellACow ( )
  {
    numberOfCows = numberOfCows - 1;
  }

  public int getNumCows ( )
  {
    return numberOfCows;
  }

  // Hay methods

  public void setNumBales(int hay)
  {
    balesOfHay = hay;
  }

  public void makeHay(int hay)
  {
    balesOfHay=balesOfHay+hay;
  }

  public void useABale ( )
  {
    balesOfHay = balesOfHay - 1;
  }

  public int getBalesOfHay ( )
  {
    return balesOfHay;
  }
}

