Question: You are given the Shape class to be used as a base for other shapes. Create a Triangle class based on the UML diagrams below.

You are given the Shape class to be used as a base for other shapes.
Create a Triangle class based on the UML diagrams below.
Note that the triangle is equilateral, all three sides are the same length.
The formula for the area of an equilateral triangle is as follows:
area =( sqrt(3)/4) side^2
The default side length of a newly constructed triangle should be 1.0.
The name of a newly constructed triangle should be "triangle".
You are given the Shape class to be used as a

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!