Question: PLEASE USE JAVA AS A PROGRAMMING LANGUAGE AND USE DIFFERENT CLASS FOR CIRCLE, RIGHT TRIANGLE AND THEN THE APPLICATION. Create a class Circle with one

PLEASE USE JAVA AS A PROGRAMMING LANGUAGE AND USE DIFFERENT CLASS FOR CIRCLE, RIGHT TRIANGLE AND THEN THE APPLICATION.

Create a class Circle with one instance variable of type double called radius. Then define an appropriate constructor that takes an initial value for the radius, get and set methods for the radius, and methods getArea and getPerimeter.

Create a class RightTriangle with three instance variables of type double called base, height, and hypotenuse. Then define an appropriate constructor that takes initial values for the base and height and calculates the hypotenuse, a single set method which takes new values for base and height and calculates the hypotenuse, get methods for all three instance variables, and methods getArea and getPerimeter.

Then create a test application which queries the user for the needed data to create two Circle objects and two RightTriangle objects. It will then display all information about the four objects. It should then display which Circle object has the largest area and which RightTriangle object has the largest area.

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 Databases Questions!