Comp 212 Lab 06: Review For Exam 1


Click here to download a PDF copy of exam 1 of the Spring 2002 semester.  This semester's exam 1 will have a similar format and similar type of questions.  Use the lab time to work on the old exam as a way to prepare for the upcoming exam.  Feel free to discuss the problems with your lab mates.  The labbies are there to help you too.

Questions #1 and #2 refer to a list framework specified by three interfaces: AList, IListAlgo, and IListFactory.  This framework is analogous to the listFW framework discussed in class this semester: IList, IEmptyList, INEList, IListAlgo and IListFactory  See section 1 (Yet Another Functional List Structure) of lecture 11.  You should be able to do these problems by applying your knowledge of the immutable list framework (IList, etc) that we study this semester.

Question #3 refers to a homework assignment in the Spring 02 semester.  It  is about understanding an existing design and modifying the design to use the visitor pattern.  It entails identifying which classes form the hosts, add accessor methods ("gettors") to access the internal data and a "hook" method to "accept" visitors, and write an appropriate visitor interface with methods matching each of the hosts.  Note there are more than one solutions to this problem.

Question #4 is about studying the description of some type of data and build and object model for it.  No coding is required, only UML class diagrams.

Question #5 requires that you read and understand a UML diagram of a visitor pattern and write an appropriate visitor for it.

Exam 1 of this semester will be similar to the above exam in that it will ask you

NOTE: Exam 1 will not cover LRStruct, the mutable list structure.


dxnguyen@cs.rice.edu
revised 09/30/2002