![]() Implement classes for the chick and the pig. ![]() Here is a Cow class meeting the minimum requirements to be an Animal. Once we know what it takes to be an Animal, we can define new classes for the cow, chick and pig that implement the Animal interface. Run the program to make sure it compiles and runs. This interface defines those things required to be an animal on the farm.Ĭomplete the Animal interface in the Animal.java file. Every animal shared certain characteristics: they had a type (such as cow, chick or pig) and each made a sound (moo, cluck or oink). Old MacDonald had a farm that had several types of animals. In this assignment we will use Old MacDonald's Farm to learn how implements and extends work, and the meaning of inheritance and polymorphism. You may find slides 53 - 130 on OOP-Interfaces, Inheritance & Encapsulation and the encapsulation worksheets helpful. As you read through the assignment below, add code to your OldMacDonald program when you get to any instructions in italics. ![]() ![]() Start by forking and the cloning this repository.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |