// @(#)$Id: extra.txt,v 1.3 1997/06/03 23:06:57 leavens Exp $ (a) Can you modify answer 1 to say that when the product would be out of range, that the exception is thrown, but without specifying exactly the value of the exception. (Hint: use a quantifier.) (b) According to the C++ interpretation of a function interface, is the following specification legal? struct Overflow {int a; int b;}; int multiply(int i, int j); // no throw(Overflow) declared //@ behavior { //@ requires inRange(i * j); //@ ensures returns /\ result = i * j; //@ also //@ requires ~inRange(i * j); //@ ensures throws(Overflow) /\ thrown(Overflow) = [i, j]; //@ } Why or why not? (c) How would you specify multiply so that when the product cannot be represented, it either throws the exception, or returns some (arbitrary) int? (d) Write a specification of multiply that, when the product cannot be represented, prints an error message on cerr and aborts the program.