130k views
2 votes
Worth 10 points

(Sum series)
Write a method to compute the following series:
m(i) = 1/2 + 2/3 +......+ i/(i+1)
Class Name: Exercise06_13

1 Answer

5 votes

In Java:

public class Exercise06_13 {

public static void main(String[] args) {

System.out.println(Series(Just put whatever number you want here, and it will print out the number in the series.));

}

static float Series(float i){

return (i / (i + 1));

}

}

I hope this helps!

User Mejdi Lassidi
by
6.1k points