okay so....
public static double m(double i)
{
double sum = 0;
sum += (double) (i / (2*i + 1));
total = sum + sum
return total; //Will this return the accumulative...
Type: Posts; User: brobertson300
okay so....
public static double m(double i)
{
double sum = 0;
sum += (double) (i / (2*i + 1));
total = sum + sum
return total; //Will this return the accumulative...
I understand it is a poor name for a method however thats what the teachers instruction are. Do I need to call the method into my println?
--- Update ---
import java.text.DecimalFormat;
...
When I compile it shows the 'i' = 1,2,3,4....20 but the m(i) is 0,0,0,0.... and needs to be 0.3333, 0.7333.... all the way to 9.2480... its supposed to add all the fractions together and display......
Okay so I have to write a method to compute the following series: m(i)= 1/3 + 2/5 +....+ (i / 2i+1) and write a test program that displays a table " i = m(i)" 1=0.3333 2=0.7333....all the way down...