// @(#)$Id: extra.txt,v 1.4 1997/06/03 23:06:51 leavens Exp $ Extra credit problems: (a) In Larch/C++, specify a C++ function, sqrt, that computes an approximation to the square root of a double. Your specification should have the following outline. double sqrt(double i) throw(); //@ behavior { //@ requires ...; //@ ensures ...; //@ } You are to fill in the dots. (b) In Larch/C++, specify a C++ function, isqrt_proc, that computes an approximation to the square root of an integer and assigns it to a reference parameter in its second argument. Your specification should have the following outline. void isqrt_proc(int i, int& answer) throw(); //@ behavior { //@ requires ...; //@ modifies answer; //@ ensures ...; //@ } You are to fill in the dots. (c) In Larch/C++, specify a C++ function, isqrt_side_effect, that computes an approximation to the square root of an integer and assigns it to the global variable isqrt_answer. Your specification should have the following outline. void isqrt_side_effect(int i) throw(); //@ behavior { //@ extern int isqrt_answer; //@ requires ...; //@ modifies isqrt_answer; //@ ensures ...; //@ } You are to fill in the dots.