Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA Define an abstract class called GeometricFigure with height and width attributes. Include an abstract method to calculate the surface area of the object. Define

JAVA
image text in transcribed
Define an abstract class called GeometricFigure with height and width attributes. Include an abstract method to calculate the surface area of the object. Define TWO (2) subclasses named Square and Triangle that inherit the abstract class GeometricFigure. Define all abstract methods accordingly. Define a Java interface called SizeComparable that contains an abstract method called comparesize(). This method will compare the surface area of two Geometric Figure objects and display whether the object surface area is smaller, larger or equal to the other object's surface area. Provide another class with the main () method to demonstrate the above concepts. (25 Mark)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

Students also viewed these Databases questions

Question

Discuss the techniques of sales forecasting.

Answered: 1 week ago

Question

Write short notes on Marketing mix.

Answered: 1 week ago

Question

Analyse the process of new product of development.

Answered: 1 week ago