Search:

Type: Posts; User: brobertson300

Search: Search took 0.09 seconds.

  1. Replies
    9
    Views
    1,305

    Re: writing a method to add fractions?

    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...
  2. Replies
    9
    Views
    1,305

    Re: writing a method to add fractions?

    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;
    ...
  3. Replies
    9
    Views
    1,305

    Re: writing a method to add fractions?

    2829
  4. Replies
    9
    Views
    1,305

    Re: writing a method to add fractions?

    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......
  5. Replies
    9
    Views
    1,305

    writing a method to add fractions?

    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...
Results 1 to 5 of 5