|
|
|
|
30 Points Due: 5/02/01 at the start of class
Complete each of the following problems:
- Chapter 10, Problem 9 (p. 433)
- Consider the following four alternatives for handling errors in
subprograms:
- 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.
- 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.
- Use Ada's exception-handling model.
- 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.
|