This lab is quite simple. I'm giving you a compiled Java program
Plotter.jar, and the source code for
Lab07a.java. Download them now with the commands:
curl -O http://www.usna.edu/Users/cs/wcbrown/courses/S16IC211/lab/l07/Plotter.jar curl -O http://www.usna.edu/Users/cs/wcbrown/courses/S16IC211/lab/l07/Lab07a.javaCompile Lab07a.java and run it like this:
java Lab07a | java -cp Plotter.jar Plotter... you'll see a cool little visual. The gist is that Lab07a (which you can run on your own, by the way) outputs row, column and color (r=red, b=blue, g=green, o=orange, y=yellow, m=magenta, p=pink) for moving dots.
19 70 r ← round x, red dot at row=19, col=70 76 1 b ← round x, blue dot at row=76, col=1 done 19 69 r ← round x+1, red dot at row=19, col=69 76 2 b ← round x+1, blue dot at row=76, col=2 done ...If you run it as instructed, the output of Lab07a is piped into Plotter, which plots each of the dots at the row,col coordinates and color given. The "done" at the end of a group of lines tells us that we are done with the "round", so now the updated display should be shown, and what follows will be values for the next "round".
So what do you have to do? Well, the program Lab07a is written entirely as a Procedural Program. You will re-write it as an Object-Oriented Program, and once done, you will extend its functionality a bit as well.
Lab07b.java, and you will (presumably) be creating other .java files as well. The output of Lab07b should be just like Lab07a, but the design must follow all the good object oriented design principles we have discussed. In particular, you must use encapsulation and information hiding, inheritance and polymorphism. Maximize code reuse, keep implmentation and interface as separate as possible.
You must do two things:
~/bin/submit.ic211 lab07 README *.java *.jarYour instructor may also ask you to demo the lab, so make sure to ask about that.