Comp 212 Homework 2
Visitor
Due Sept. 22, 2000 11:59 PM.
This homework exercise serves as a drill on applying the visitor pattern to the Scheme list structure. It is based on homework 01 and lab 03.
Your task is to write algorithms on lists as visitors as specified in the following problems. You are free to add any private and protected methods to your visitor classes to support your public operations. You are also free to write helper visitors to support your main visitors. You are not allowed to check for the type of AListFW, such as using instanceof or add a method to check for the type, to perform any task. The classes AListFW, EmptyListFW, NEListFW, and ListFWFactory should be in a package named scheme2 as shown in lab 03. The visitors should be in the package scheme2.visitor.
Each of the above problems should be done independently from each other. For each of the above problems, be sure to add test cases which cover all reasonable cases. As with all programs in this course, lack of good coding style (good style includes reasonable variable names, a header before each non-overridden function, reasonable indentation) will result in a substantial loss of points. The code should be documented in javadoc style.
The homework is due Friday Sept. 22, 2000 11:59 PM. It is to be submitted electronically. Your labbies will give you specific submission instructions in the upcoming lab tutorial. No late submission will be accepted. The complete homework set should contain the following: