Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualPink Horror

Posted 23 July 2013 - 10:48 PM


                increase += total - increase;
                return increase;

 

You are return as soon as you find some j > 0, which is quarter 2 in division 1.

 

(ignoring any floating point strangeness)

 

increase += total - increase;

 

is the same as:

 

increase = increase + total - increase;

 

is the same as

 

increase = total;

 

So, quarterlyIncrease just does this:

 

return arr[0][1];

 

I cannot figure out what you want this code to do, but I hope I can help you see what it does do.

 

I've looked at it a little more. From the list function, I see you want to call quarterlyIncrease for each iteration. That's ok. You only provide the array as input, which means that it naturally would return the same thing over and over, unless you has some sneaky globals in there. You should pass your quarter and division indices into this function.


#1Pink Horror

Posted 23 July 2013 - 10:43 PM


                increase += total - increase;
                return increase;

 

You are return as soon as you find some j > 0, which is quarter 2 in division 1.

 

(ignoring any floating point strangeness)

 

increase += total - increase;

 

is the same as:

 

increase = increase + total - increase;

 

is the same as

 

increase = total;

 

So, quarterlyIncrease just does this:

 

return arr[0][1];

 

I cannot figure out what you want this code to do, but I hope I can help you see what it does do.


PARTNERS