Question: Each student should do their own work, but may use Google or any other references, including asking questions of their classmates. This program must be

Each student should do their own work, but may use Google or any other references, including asking questions of their classmates. This program must be your work only. Programming assignments must be submitted in eCampus to receive credit. The Intelli-J project folder with its contents should be compressed into a single zip file and the zip file attached to the assignment submission. Programs must compile and run without errors to receive credit. Each assignment may be submitted up to three times to improve your grade.
Part 1:
Each of the following classes will be placed in a separate source file. Create the following artifacts:
Animal, with the String attributes name and breed.
Cat and Dog are subclasses of Animal.
AnimalI, an interface declaring two methods makeSound and whatAml that return strings.
Each of the three classes will implement the interface, have a constructor and getter methods for each attribute. I suggest using the Generate option from the Code dropdown menu to generate these "boilerplate" methods. Also, the Animal class needs a toString method which references the whatAml and makeSound methods. The Cat and Dog classes should NOT have toString methods.
Finally, a Main class (see below) that will create a Scanner object to read a text file (see example below) containing three fields, separated by commas, type, name, and breed. Depending upon the type (A, C or D), create an Animal or Cat or Dog object and store it in an Arraylist of animals.
After all records have been read, iterate through the Arraylist to print the animal using the tostring method.
Don't forget to close the text file.
 Each student should do their own work, but may use Google

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!