Question: Instructions Create a class RightTriangle which implements the API exactly as described in the following Javadoce. Don't forget - you will need to use the

 Instructions Create a class RightTriangle which implements the API exactly as

Instructions Create a class RightTriangle which implements the API exactly as described in the following Javadoce. Don't forget - you will need to use the Pythagorean theorem e to find the hypotenuse (and therefore the perimeter) of a right triangle. You can find the area of a right triangle by multiplying the base and height together, then dividing this product by 2. Use the runner_RightTriangle file to test the methods in your class; do not add a main method to your RightTriangle class. Hint 1 - Javadoc only shows public methods, variables and constructors. You will need to add some private member variables to your Right Triangle class to store the necessary information. Think carefully about what information actually needs to be stored and how this will need to be updated when methods change the state of a Right Triangle object. Hint 2 - As in the previous lesson's exercise it's helpful to add your method/constructor headers and any dummy returns needed before implementing each one properly. This will allow you to test your code using the runner class as you go along

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!