Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    9
    Views
    1,310

    Re: writing a method to add fractions?

    total = sum + sum

    Did that code compile? It's better if you compile and execute the code BEFORE posting it.

    That looks the same as: total = 2*sum;

    Where is the value from the last call to...
  2. Replies
    9
    Views
    1,310

    Re: writing a method to add fractions?

    If a method is NOT called, it does not execute. If it does not execute, it will not compute any value.

    --- Update ---


    If you want to accumulate the sum of previous values with the current...
  3. Replies
    9
    Views
    1,310

    Re: writing a method to add fractions?

    BTW m is a poor name for a method. The name of a method should be a verb saying what the method is doing.

    Where is the m method called?
  4. Replies
    9
    Views
    1,310

    Re: writing a method to add fractions?

    What does the program print out when it executes? Can you copy the exact output and not interpret it in text?

    BTW m is a poor name for a method. The name of a method should be a verb saying what...
  5. Replies
    9
    Views
    1,310

    Re: writing a method to add fractions?

    What happens when you compile and execute the code? Copy the output and paste it here. Add some comments to the posted output showing what the output should look like.
Results 1 to 5 of 5