import java.io.*;

/*An application class to test the farm class */

class testFarmApp
{
    public static void main(String args[])
       throws java.io.IOException

    {

    // declare some variables for use

    int calves;
    int porkers;
    int forage;

    // instantiate first farm supplying no values

    Farm homeFarm = new Farm();

    // instantiate second farm supplying farmerName

    Farm scotchFarm = new Farm("Old McDonald");

    // allocate different values to each variable in both farms

    /*
     This will not work

    homeFarm.farmerName = "Giles";

     because the variables are private
    */

    // This will work

    homeFarm.setFarmerName("Giles");
    homeFarm.setNumCows(5);
    calves = 6;
    homeFarm.addSomeCows(calves);
    forage = 10;
    homeFarm.setNumBales(forage);
    homeFarm.makeHay(30);
 
    // printout details of each farm

    System.out.println("Farmer "+
       homeFarm.getFarmerName()+" has "+
       homeFarm.getNumCows()+" cows and "+
       homeFarm.getBalesOfHay()+ " bales of hay");

    System.out.println(
       scotchFarm.getFarmerName()+" has "+
       scotchFarm.getNumCows()+" cows and "+
       scotchFarm.getBalesOfHay()+ " bales of hay");

   }
}

