Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class named Triangle.java implementing TriangleInterface. Include the following data members and methods: three double data members representing the three sides of a triangle

Create a class named Triangle.java implementing TriangleInterface. Include the following data members and methods:

three double data members representing the three sides of a triangle (private)

Constructor which takes three double numbers representing the three sides of the triangle

getter methods

public void setSides(double a, double b, double c) to set three sides of a triangle

Implements the methods specified in the interface

If the three numbers can not form a valid triangle, assign 0 to all sides.

Once completed, create a plain text file named result.txt, then summarize (copy) the result from running the Grader.class

public interface TriangleInterface extends Comparable{ public double area(); //keep two decimal places public int compareTo(TriangleInterface tri); //the compareTo method returns the difference of the area between caller and argument triangles. Cast the area difference to int }

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_2

Step: 3

blur-text-image_3

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago