CS 3304 Spring 2001 Homework Assignment 12

30 Points
Due: 5/02/01 at the start of class

Complete each of the following problems:

  1. Chapter 10, Problem 9 (p. 433)

  2. Consider the following four alternatives for handling errors in subprograms:

    1. All subprograms in which errors might occur must include an "error code" parameter that can be set to some value representing "OK" or some other value indicating the kind of error that has occurred.
    2. All subprograms in which errors might occur must include an error-handling procedure as a parameter, so that this procedure can be called if an error arises.
    3. Use Ada's exception-handling model.
    4. Use C++'s exception-handling model.

    In a table, present both the advantages and disadvantages of each of the four approaches. You may discuss possible advantages and disadvantages with classmates to ensure you have covered as many as possible in your answer (you may not help each other write up your answers, of course). Based on your table, pick which approach is the best and justify your choice.

copyright © 2001 Virginia Tech, ALL RIGHTS RESERVED
Last modified: April 23, 2001, 15:39:00 EDT, by Stephen H. Edwards <edwards@cs.vt.edu>