Follow up to Programming Exercise 5.25

In the previous homework assignment you wrote a program to approximate π by using the following summation:

In this exercise you are going to reorganize your code to use a method.

What to do

Write the code for a method

public static double approximatePi(int i)

that can compute the sum

In the main method for your program you will construct a loop that calls this method for values of i from i = 10000 through i = 100000 in steps of size 10000. The loop will print a table of values for i and your pi estimate.