Homework V

 

 

Problem 1 [35 points]

For this problem, the telephone database from chapter 4 of Diller is to be revised. The modification is to provide for 'unlisted' numbers -- that is, numbers known to the system, but which should indicate 'Unlisted' if requested (e.g., FindPhones). So there are to be two new operations specified: DoUnlist, and DoRelist; the first of these operations should take a set of persons and a listed phone as arguments  and make the number unlisted, and the second should take a set of persons and an unlisted phone as arguments and make the number listed. Of course, the DoFindPhones operation should be changed to give the report 'unlisted' rather than returning the number whenever that is appropriate.

 

Since a phone may serve several persons, we want to ensure everyone involved agrees to the change in a listing status. Information for this check is provided to the new operations by the first argument listing the names of the persons requesting the status change. If this set does not agree with the set of persons assigned to the phone, the change should not be made and a error report should be issued.

 

Show all the changes needed to Diller's definitions as well as your schemes for the two new operations.

 

 

Problem 2. [35 points]

For this problem you should modify the Zans animation of Diller's telephone database in the class directory to reflect the specification changes you develop in problem 1. Your submission for this problem should include:

* a printout of a Zans log illustrating the correct behavior of the new/changed operations

* electronic submission of a copy of your Zans source code to the directory Hwk5 (for course c181)