You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
453 B
9 lines
453 B
2 years ago
|
|
||
|
Exercise 2.3: Implement a representation for
|
||
|
rectangles in a plane. (Hint: You may want to make use of Exercise 2.2.)
|
||
|
In terms of your constructors and selectors, create procedures that compute the
|
||
|
perimeter and the area of a given rectangle. Now implement a different
|
||
|
representation for rectangles. Can you design your system with suitable
|
||
|
abstraction barriers, so that the same perimeter and area procedures will work
|
||
|
using either representation?
|