Sum of a series

Assignment

Solution 

packagecom.assignment;

public class Main {

public static double sumSeries(int m){

double sum = 0;

for(int i =1; i<=m; i++)

{

sum+= (double)(i)/(double)(i+1);

}

return sum;

}

public static void main(String[] args) {

System.out.println(“i     m(i)”);

for(int i =1; i<=20; i++)

{

System.out.println(i + ”     ” + sumSeries(i));

}

}

}