Write a void access method named eat which takes a single String parameter that represents a type of food -- ``spinach,'' ``ice cream,'' and so on. The method should take the food string that is passed to it and assign it to an instance variable named food.
Note that this new method will have the same name as an existing method in CyberPet. How will these two methods be distinguished from one another?
Modify the TestCyberPet application program so that it will conduct appropriate tests to make sure your new eat() method is working properly. When you are finished, the output should match the output shown above in the problem statement. Your test algorithm should tell your CyberPet to eat certain foods.
Be sure to make appropriate use of private and public in your revisions to the CyberPet class.