Assignment 3

CS 152
due November 5, 1997
(100 points, plus 10 points extra credit)

Redo Assignment 1, using Ada. Use the same data files as for Assignment 1.

Assume that the input files use the same representation as in Assignment 1. Once again, output may be sent either to the screen (standard output) or to a file.

Your program should use the separately compiled package in the file "mytask.ads" that I have provided you. You will need to modify this file, at least by giving in the private area the definitions of the types named in the public area. You will also need a file containing a package body corresponding to the package specification in the file provided. Your top-level function should be in a separate file. You may use additional files, package bodies, and package specifications if you wish.

You should be able to detect and handle the same 3 types of errors you were required to check in Assignment 1. However in this assignment, you may use the primitive exception-handling facilities of Ada to check for nonexistent files. Nonetheless, you should test for a nonexistent file as well as testing the seven files given to you for Assignment 1.

For 10 points extra credit, you may write exception handlers to check for (i) nonexistent files and (ii) empty task sets passed to the topological sort algorithm. Your exception handlers need only print a special error message of your choice, and reraise the original exception.

It might be easier for you to store the lengths of the task names along with the names themselves.

Don't forget to document which file contains your top-level function.