Incremental development: - getting from nothing to a final program in baby steps - each step should be small and testable ==[ Example: Zoo Displayer ]== 0. Create ZooDisplayer.java with (a) a comment at the top saying who you are and what this program is (b) class with main method with just a print statement. Compile, test, fix, compile, test, cheer; save a backup copy. 1. Write a 'public static void loadZoo(String filePath)' method that opens and loop through the file and print a count of the lines in the file. Add 'loadZoo("ZooExample.txt")' to main to test. Compile, test, fix, compile, test, cheer; save a backup copy. 2. Update ZooDisplayer's main to process the command-line arguments to get the name of the input file, and send it to loadZoo. Write usage statement. [Compile, test, fix, compile, test, cheer; save a backup copy.] (I'll stop reminding you, but you should always do this before the next step.) 3. Create a variable with type List and instantiate a new ArrayList. Store each line in the list. Return the list from loadZoo (change 'void'). Back in main, store the return value (how?), iterate over it, and print out one line at a time. 4. Create ZooAnimal.java with (a) a comment at the top: who are you, what is this? (b) a "private String name;" instance variable (c) a one-parameter constructor that sets the name (d) String getName() that lets other classes get an animal's name Try "javac ZooAnimal.java" to make sure it compiles. (Can't run it yet.) 5. Add a main to ZooAnimal.java that acts as a unit test. It should instantiate one ZooAnimal object, call getName to get (and then print) its name. 6. Back to ZooDisplayer.java. Change mentions of "ArrayList" to "ArrayList". For each line in the input file, instead of adding the line to the list, instantiate a new ZooAnimal with that line, and add the new ZooAnimal object to the list. In main(), iterate through the list and print each ZooAnimal's getName value. At this moment, you can just view the animal's name as being the whole line, so Lola's name might be "Lola,lemur,2005,zooPics/lemur.jpg". 7. Add new instance variables to ZooAnimal, along with appropriate changes to constructors, getters, and setters. Test them by enhancing the main method in ZooAnimal. 8. Back in ZooDisplayer.java. Use String methods on each line of the file to split out the components of each line to populate the data in each ZooAnimal object. 9. Make method displayTextZoo, move the code in main that prints out each ZooAnimal's name there, and enhance to print out name, species, and age. At this point, you have a program that reads lines of data from a file into an ArrayList of ZooAnimal objects, each of which represents an animal with 4 discrete items of data. Your main program in ZooDisplayer can call displayTextZoo to print out the list of animals in the same order it appears in the file. 10. Write sortZooAnimalList. Call it in main after loading and before printing. Make a copy of ZooExample.txt and change the names, species, and birth years in various critical ways to test and make sure sorting is done correctly. 11. Write displayZooImage. First make it display an image of only the first animal, then try to append the second image. Once you are sure you know how to append, you can grab the loop from displayTextZoo and use it to append all images. 12. Modify the command-line argument handling to call displayTextZoo or displayZooImage. Possibly also update the usage statement. If I'm not mistaken, you are now done with the assignment. None of these steps was trivially easy, and some were probably challenging in various ways, but they were all modestly sized and easy to test. One of the things that marks an experienced programmer is the ability to organize work in these small, testable steps. (In some programming teams, describing these steps is required before one gets to start coding at all.) Practice this. It helps turn complex and scary jobs into a sequence of manageable and non-scary jobs. [This plan adapted from Jeff Ondich's plan for a different assignment.]