Question: Compare ADA discriminated record types with JAVA classes and subclasses, in terms of extensibility. (a) Define the following ADA function, where Figure is the discriminated

Compare ADA discriminated record types with JAVA classes and subclasses, in terms of extensibility.

(a) Define the following ADA function, where Figure is the discriminated record type of Example 8.3: function area (fig: Figure) return Float; (b) Now suppose that straight lines and text boxes are to be handled as well as points, circles, and rectangles. Modify the ADA code (type and function definitions) accordingly. (c) Add definitions of the following JAVA method to each of the classes of Example 8.4:

float area ();

(d) Now suppose that straight lines and text boxes are to be handled as well. Modify the JAVA code accordingly.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!