Homework VIII

(70 points)

 

 

For this problem, the initial algebra version of the telephone database phonedbADT2.m in our class directory 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, and both operations should respond appropriately to exceptional cases. Of course, the DoFindPhones operation should be changed to give the report 'unlisted' rather than returning a number whenever that is appropriate, and other operations should be revised as necessary.

 

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

 

Clearly identify all the changes needed to the original specification, as well as your definitions for the two new operations.

 

Your submission for this problem should include:

* a printout of your code and a script justifying the correct behavior of all cases (e.g., before/after list or unlist, various configurations, etc.) for new/changed operations

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