Question: Please I need help with project. Assignment: Triangle Problem Description: Design a class named Triangle that is a subclass of Geometricobject (View this video o

Please I need help with project.

Please I need help with project. Assignment: Triangle Problem Description: Design a

Assignment: Triangle Problem Description: Design a class named Triangle that is a subclass of Geometricobject (View this video o understand the Geometric Object Hierarchy). The Triangle class contains: e Three double data fields named sidel, side2, and side3 with default values 1.0 to denote thgee sides of the triangle e A no-arg constructor that creates a default triangle e A constructor that creates a triangle with the specified sidel, side2, and side3 e The accessor methods for all three data fields e A method named getArea() that returns the area of this triangle e A method named getPerimeter() that returns the perimeter of this triangle e A method named toString() that returns a string description for the triangle e The toString() method is implemented as follows: return "Triangle: sidel = " t sidel it side2 Bl (8 ishde) B 2 side3 " + side3; Draw the UML diagram that includes the classes Triangle and GeometricObject. Implement the class. Write a test program that creates a Triangle object with sides 1, 1.5, 1, color yellow and filled true, and displays the area, perimeter, color, and whether filled or not. Hint: Let a, b, be the lengths of the sides of a triangle. The area is given by: Area = ~\\/p(p-a)(Pb)(p-c) p.(atbic)/2 Analysis: (Describe the problem including input and output in your own words.) : Design: (Draw an UML class diagram) Testmg (Describe how you test this program)

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