Question: Java language Approximating a Square Root Using a Loop Out: 10/4 Due: 10/15 by 11:50 PM Using Iteration, More on Basic Arithmetic Operations, More on

Java language

Java language Approximating a Square Root Using a Loop Out: 10/4 Due:10/15 by 11:50 PM Using Iteration, More on Basic Arithmetic Operations, Moreon Decision Statements, and More on Writing Interactive Programs Definition 1. Aquare root of a number n is a number s such that

Approximating a Square Root Using a Loop Out: 10/4 Due: 10/15 by 11:50 PM Using Iteration, More on Basic Arithmetic Operations, More on Decision Statements, and More on Writing Interactive Programs Definition 1. A quare root of a number n is a number s such that In this project, you will use a loop to approximate the square root ofa number. There is an elementary algorithm used to find the square root of a number that takes advantage of a mathematical principle commonly referred to as the pinching (a.k.a. squeezing or sanduwrich) theorem. The theorem simply means that given any closed continuous interval [a, bl, there is a number p such that a 100, so we can obtain a better approximation by squeezing our interval to its lower half, 1,50.5]. Next, we consider the midpoint of this interval. 25.75x25.75 > 100, so we choose the lower half of the interval, [1, 25.75). 13.375 13.375 > 100, so we narrow the interval to [1, 13.375], the lower half of the interval. 7.18757.1875 100, so we narrow the interval to its lower half, (7.1875, 10.28125], etc. we will eventually obtain a midpoint whose square gives us 100. Due to truncation and roundoff errors by computers, Duncan Fall 2017

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!