Question: 1 Your Job You will write a class to model a Right angle Triangle. Recall that a right angle triangle can be described by specifying

 1 Your Job You will write a class to model aRight angle Triangle. Recall that a right angle triangle can be described

1 Your Job You will write a class to model a Right angle Triangle. Recall that a right angle triangle can be described by specifying only two sides: height and width. Given the two sides, we can calculate the third side (called hypotenuse) by using the following formula: height2 + width2 Given a triangle some methods of interest are: Calculate the area, calculate the perimeter, Create a class named RightAngleTriangle. This class should have the following methods and compare the area with another triangle. constructors RightAngleTriangle. A default constructor. Creates a RightAngleTriangle whose height and width is1 RightAngleTriangle(int hei, int vid). A specific constructor. Creates a RightAngleTriangle with height hei and width wid. If any of hei or wid are negative, then creates a RightAngleTri- angle with height and width 1 area. Returns the area of the RightAngleTriangle perimeter. Returns the perimeter of the RightAngleTriangle. isIsosceles returns true if height is same as width. largerThan (RightAngleTriangle anotherRightAngleTriangle). Returns true if and only if the area of this RightAngle Triangle is larger than the area of anotherRightAngleTriangle. Once you finish writing the class RightAngleTriangle, create another class named TestRightAngleTriangle that contains a main method. The main method must do the following: 1. Create a RightAngleTriangle named unitRightAngleTriangle using the default constructor 2. Create a RightAngleTriangle named r1 with height 5 and width 4

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