Create a uml for a class called


Create a UML for a class called triangle. It will have an argument constructor that sets the sides to be side 1 as 10, side 2 as 10 and side 3 as 10. It sets the height to 15.Note that side 3 is the base. It will have a method called setDimensions ( int s1, int s2, int s3, int h) as a void that will set the sides to any values passed and any height passed. It will have a method get Area() that will return the area of the triangle as a return type. it will have a method isEquilateral () as void that will display: Your triangle is an equilateral if all 3 sides are the same value, else it will say: Your triangle is not an equilateral. After creating the UML, create the java code.
Test the code by creating a tester file called TestTriangle, it will create one object t1 that will be the default triangle values. It will create object t2 that will use the setDimensions() method to set the values to 10,15, 20 for sides and 25 for height of triangle. Call the getArea () on t1 and display via main method: The area of the first triangle is 50. Then also call the isEquilateral on t1. Then call the getArea () for t2 and display via the main method: the area of the second triangle is _____. After that call the isEquilateral() for t2.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Create a uml for a class called
Reference No:- TGS0944643

Now Priced at $30 (50% Discount)

Recommended (91%)

Rated (4.3/5)