Final answer:
To compute the given series, we can use a loop to iterate through the numbers and add the terms to a sum variable.
Step-by-step explanation:
To write a method to compute the given series, we can use a loop to iterate through the numbers from 1 to i. For each iteration, we can add the term i / (i+1) to a sum variable. Here's the code for the method:
public static double computeSeries(int i) {
double sum = 0;
for (int j = 1; j <= i; j++) {
sum += (double) j / (j + 1);
}
return sum;
}
We can then write a test program to display the table by calling the method for each value of i and printing the result:
public static void main(String[] args) {
System.out.println("i\tm(i)");
for (int i = 1; i <= 20; i++) {
System.out.printf("%d\t%.4f\\", i, computeSeries(i));
}
}