Wite a method to computer the following series mi 12 23


Write a method to computer the following series: m(i) = 1/2 + 2/3 + . . . + i/i + 1

Write a test program that displays the following table: I m(i) 1 0.5000 2 1.1667 . . . 19 16.4023 20 17.3546

Formulas to achieve the above are: sum += k / (k + 1.0);

This would be placed within a for loop in the method m(). The for loop header can be written: for (int k = 1; k <= i; k++) One thing to notice here is the table. The results are for the numbers 1-20.

Solution Preview :

Prepared by a verified Expert
Programming Languages: Wite a method to computer the following series mi 12 23
Reference No:- TGS01706524

Now Priced at $35 (50% Discount)

Recommended (92%)

Rated (4.4/5)