Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1 Make sure to answer both parts. Part1: Design a Triangle to have three variables to store the length of each side of the

image text in transcribed
QUESTION 1 Make 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 - side 1+ side2 + side3 s-(side1 + side2 + side3)/ 2.0 Area Vide1)-Midea 36-side) Part 2: Write a test class named Test'Triangle to declare an ArrayList to store objects of type Triangle, use a loop to read data for 5 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 toolba pret ALT 10 (PC) OF ALTIN 10 (Mac. BTVS Paragraph Arial 14px ***

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

Step: 3

blur-text-image

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

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions