Finch visits the Farm
The Finch has visited a farm recently and would like to mimic the animals at the farm. Could you help the Finch do this? Make a class that has the following public and private methods:
boolean setAnimal(String animal)
A driver program should ask the user for an animal and then interact with the class through the public methods, setting a state variable for the desired animal and using the playAnimal method to call the appropriate private animal method. When should the driver program use setRandomAnimal? Private methods for the different animals should do their best to have the Finch imitate the animal through movement, sound, and light. You may find this site useful in conjunction with the playClip method.
A couple of the public methods are boolean to add an extra layer of error reporting to the class. setAnimal should return true if the String argument is one of the five animal types (cow, horse, duck, chicken, or sheep), and false otherwise. playAnimal is also boolean - it should return true if a valid animal has been set by a call to setAnimal or setRandomAnimal, and false otherwise.