NOTE: Because of browser security restrictions, Java applets are not able to read/write files on your hard drive. So when you tell this applet to read/write files, it reads/writes them from an internal cache instead. When you leave this page, any output files you wrote will disappear from the program's memory. If you want the sample solution to be able to read/write actual files, please download the JAR and run it as a stand-alone application.
This page is a solution to the homework assignment that was written in Java by the instructor. We are providing it to you as an example of the behavior that your program should have. As much as possible, this applet solution matches the behavior described in the homework spec. But since it is written in Java rather than C++, it may have some small differences in appearance and behavior when compared to the spec. Whenever there is a conflict between the behavior of this sample solution and the spec, please follow the spec.