Question: need part 2 only. java Make sure to answer both parts. Part1: Design a Triangle to have three variables to store the length of each
need part 2 only. javaMake sure to answer both parts. Part1: Design a Triangle to have three variables to store the length of each side of the triangle (25 Points) Your class must include all the necessary methods: (you may add more methods or variables if you like) Constructors (Default,parenthesized values of the 3 sides are passed to it), and copy constructors Getters Setters toString (include sides, area, and perimeter)equals calcArea calcPerimeter Required formulas: Perimeter = side1+ side2 + side3 s-(side1 + side2 + side3)/2.0 Area -/-wideXw-widea) - side) Part 2: Write a test class named Test Triangle to declaro an ArrayList to store objects of type Triangle, use a loop to read data for S Triangles and if they are not the same store them in the ArrayList. Then print the content of the list to the monitor. Make a deep copy of one of first Triangle in the list, and modify a side and print it to the monitor (15 Points) For the toolbar, press ALTF10 PC) or ALTHFN.F10(Mac)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
