To design a Zoo, utilizing the strategies learned in previous labs and lectures, such as abstract classes, combined with a new class of self-referential data, a list. This lab intends to show how you can combine these two strategies to easily implement even complicated class heirarchies by thoroughly thinking through the data definition and knowing how to implement that definition in the frameworks of Java.
Part 1 - Who let the Dogs out?In the first section of the lab, you should download the code (exe) for the project. This code already includes both of the jar files needed to get the project running in Metrowerks as well as the Metrowerks project file and all the fixins. Yummy! The code should look familiar, a large part of it was done in the previous lab. Look over this code and if there are any questions, ask the nearest TA or tutor for help. The code should run and display some "pretty boxes" without any modification. The project currently has an implementation of the Animal class heirarchy we developed last time.
|
Part 3 - Have a little help from our friendsWe now have the two classes, the implementation of all the basics we need for a List of lions. But it seems pretty useless unless we create a few extra methods to be able to process these lists of ferocious Kings of the Jungle. Come up with a few ideas of some methods that would be useful for this List of lions. If you're having trouble, consider the following.
Implement a solution to one of the above problems. If you're ambitions, implement solutions to all of them! They all could be very useful and possibly prevent someone from being eaten!
|
We have walked through the design and implementation of a problem involving complicated data. Not only do we have self-referential classes of data, but also class heirarchies. The Data Analysis was a difficult task, but once completed lended itself easily to the implementation of the classes. In addition, this well thought out Data Analysis also leads to structured data that others can understand, as well as a program that is easily adaptable.