subject

Let’s say you are given a number, a, and you want to find its square root. One way to do that is to start with a very rough guess about the answer, x0, and then improve the guess using the following formula: x1 = (x0 + a/x0)/2 For example, if we want to find the square root of 9, and we start with x0 = 6, then x1 = (6 + 9/6)/2 = 15/4 = 3.75, which is closer. We can repeat the procedure, using x1 to calculate x2, and so on. In this case, x2 = 3.075 and x3 = 3.00091. So that is converging very quickly on the right answer(which is 3). Write a method called squareRoot that takes a double as a parameter and that returns an approximation of the square root of the parameter, using this technique. You may not use Math. sqrt. In java

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 20:00, jumpgirll
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
image
Computers and Technology, 24.06.2019 00:50, sequoyaburke
Which player type acts on other players? a. killer b. achiever c. explorer d. socializer
Answers: 1
image
Computers and Technology, 24.06.2019 08:30, colebuug9
Aconsumer would pay an extra they used the rent to own program to buy the computer, rather than using cash. for all of the items, is the cheapest option over the life of the contract. the most expensive overall option is to use purchase the item.
Answers: 2
image
Computers and Technology, 24.06.2019 12:00, yagalneedshelp8338
Match the function to its purpose. fast worth 50pts.
Answers: 1
You know the right answer?
Let’s say you are given a number, a, and you want to find its square root. One way to do that is to...

Questions in other subjects:

Konu
Mathematics, 06.12.2019 06:31