subject

Your first job is to create a java program that repeatedly asks the user whether they wish to calculate another square root. if the response is "y", then the program should proceed; if it is anything else, then the program should quit. whenever it proceeds, the program should prompt the user for a number (a positive double, and your program may simply assume the input is consistent with this requirement) and then report the square root of that number to within a relative error of no more than 0.01%. the computation must be done using newton iteration. the intuitive idea of newton iteration for computing square roots is fairly straightforward. suppose you have a guess r for x1/2 that is too large; the argument is similar if it is too small. if r is too large to be the square root of x, then x/r must be too small, so the average of r and x/r should be a better guess than either r or x/r. this suggests that if you repeatedly replace your current guess r by (r + x/r)/2, then your sequence of guesses should converge to x1/2. and indeed it can be proved that it does. a good initial guess for x1/2 is simply r = x. if you continue updating r until |r2 – x |/x < îµ2, then the relative error of the guess r will be less than îµ. after your initial program works, there are a number of other requirements to change it slightly, one step at a time, as explained below.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 12:40
Curriculum exam to process a resident's payment, you must click on onesite payments home page. from the a. reports b. my settings o c.transactions o d. rent tab
Answers: 1
question
Computers and Technology, 23.06.2019 13:00
In excel - calculate the actual increase/decrease from first quarter to the second quarter then subtract subtract first quarter value from second quarter total then divide result by first quarter value
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut-off on an hev are both colored orange.
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
What are the 12 colors of the spectrum called?
Answers: 1
You know the right answer?
Your first job is to create a java program that repeatedly asks the user whether they wish to calcul...
Questions
question
Mathematics, 05.05.2020 03:06
question
Mathematics, 05.05.2020 03:06
question
History, 05.05.2020 03:06
question
Mathematics, 05.05.2020 03:07
Questions on the website: 13722363