Convert the example of GEOMETRY_OBJECTS given in section 11.1.5 from the functional notation to the notation given in Figure 11.2 that distinguishes between attributes and operations. Use the keyword INHERIT to show that one class inherits from another class.
What will be an ideal response?
```
(GEOMETRY_OBJECTS to attribute/operation)
define class GEO_OBJECT:
type tuple ( shape : enumerated(rectangle, triangle, circle);
refpoint : tuple ( x: float,
y: float) );
operations area : float;
end GEO_OBJECT;
define class RECTANGLE:
INHERITS GEO_OBJECT;
type tuple ( width : float,
height: float);
operations square? : boolean;
end RECTANGLE;
define class TRIANGLE:
INHERITS GEO_OBJECT;
type tuple ( side1 : float,
side2 : float,
angle : float );
end TRIANGLE;
define class CIRCLE:
INHERITS GEO_OBJECT;
type tuple ( radius : float );
operations diameter : float;
ci rcumference : float;
end CIRCLE;
```
You might also like to view...
A program can create a named pipe by calling
A. pipe B. mkfifo
List and describe the utilities of information systems that can be used to evaluate the information system.
What will be an ideal response?
Discuss at length both the best and worst case of the pattern-matching algorithm.
What will be an ideal response?
You can click the Page Layout view button on the _________________________ to switch to Page Layout view.
Fill in the blank(s) with the appropriate word(s).