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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started