Alex C.
asked 09/30/17Very confused on how to write this program ?
Hi, Im freaking out because Im not sure how to write this program. :
Use a for loop to compute the following sequence of numbers that are an
approximation of √
2. The sequence depends on a starting value x0 = 1. The following values
in the sequence are then calculated as follows:
xi+1 = xi/2 + 1/xi
. (1)
For example x1 = 3/2 and x2 = 17/12. The program has to compute n terms of the
approximation, where n is the Byte variable set by the user. The last term xn is then
displayed in the Label control.
approximation of √
2. The sequence depends on a starting value x0 = 1. The following values
in the sequence are then calculated as follows:
xi+1 = xi/2 + 1/xi
. (1)
For example x1 = 3/2 and x2 = 17/12. The program has to compute n terms of the
approximation, where n is the Byte variable set by the user. The last term xn is then
displayed in the Label control.
I have no idea how to write such a program when sequences are involved! So far all I know is doing simple calculators that add/multiply numbers. Please help !!
More
1 Expert Answer
Tim C. answered 09/30/17
Tutor
5.0
(305)
Experienced and Effective Specialist in Praxis Math and GED Math
Your program just needs to follow the formula given, which is just multiplication, division and addition.
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Michael J.
09/30/17