SIBT COMP 125

Week 4 Tutorial Exercises

1. Consider a function

	square_root(value : DOUBLE; tolerance : DOUBLE) : DOUBLE
		-- find square root with given tolerance
		-- that is, Result squared is within tolerance of given value
		-- only works for non-negative values
	

Rewrite the second two comments as Eiffel pre and post conditions for the routine.

2. Write a class CUSTOMER for use in a business which sells widgets and doodads. Think of some reasonable features a CUSTOMER should have, and implement them (i.e. write the code for the routines). Some ideas to get you started: