<p>Exercise 11.1 defined the triangle class with three sides.  In a triangl
ID: 3633022 • Letter: #
Question
<p>Exercise 11.1 defined the triangle class with three sides.  In a triangle, the sum of any two sides is greater than the other side.  The Triangle class must adhere to this rule.  Create the IllegalTriangleException class, and modify the constructor of the Triangle class to throw an IllegalTriangleException object if a triangle is created with sides that violate the rule, as follows:</p><p>/** Construct a triangle with the specified sides */</p>
<p>public Triangle(double side1, double side2, double side3) throws IllegalTriangleException {</p>
<p>  // Implement it</p>
<p>} </p>
Explanation / Answer
01 importjava.util.Scanner; 02 publicclassTriangleTest { 03 04 publicstaticdoubleTriangle(doubleside1, doubleside2, doubleside3){ 05 06 07 08 if(side1Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.