Computers and Technology

Create a class RightTriangle which implements the API exactly as described in the following Javadoc (Links to an external site.). Don't forget - you will need to use the Pythagorean theorem (Links to an external site.) 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 RightTriangle 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 RightTriangle 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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:30, ruddymorales1123
Linda subscribes to a cloud service. the service provider hosts the cloud infrastructure and delivers computing resources over the internet. what cloud model is linda using
Answers: 1
image
Computers and Technology, 22.06.2019 16:30, sayedaly2096
What type of file does a cookie place on web site visitors' computers so that web site managers can customize their sites to their visitors' preferences?
Answers: 1
image
Computers and Technology, 23.06.2019 10:00, karissanichole18
Install and use wireshark program ( send back screen shots and other vital information) case project 3-2: decode a tcp segment in a wireshark capture in this chapter, you walked through tcp segment to interpret the data included in its header. in this project, you use wireshark to capture your own http messafes, examine the tcp headers, and practice interpreting the data you'll find there. 1. open wireshark and snap the window to one side of your screen. open a browser and snap that window to the other side of your screen so you can see both windows.
Answers: 2
image
Computers and Technology, 24.06.2019 13:50, jaystarr9395
Write a program that performs a simple n-body simulation, called "jumping leprechauns." this simulation involves n leprechauns, numberd 1 to n. it maintains a gold value g_i for each leprechaun i, which begins with each leprechaun starting out with a million dollars worth of gold, that is, g_i = 1000000 for each i = 1,. in addition, the simulation also maintains, for each leprachaun, i, a place on the horizon, which is represented as a double-precision floating point number, x_i. in each iteration of the simulation, the simulation processes the leprachauns in order. processing a leprachaun i during its iteration begins by computing a new place on the horizon for i, which is determined by the assignment:
Answers: 3
Do you know the correct answer?
Create a class RightTriangle which implements the API exactly as described in the following Javadoc...

Questions in other subjects: