Page 3 of 3

Posted: Mon Oct 25, 2010 5:32 pm
by Erico
Dartagn wrote:I have no clue what is going on in this thread. I assume you are making fun of me somehow.

Fuck off.
I made a program to make fun of you, it's easier on all of us :)

Posted: Thu Oct 28, 2010 9:51 am
by Moonde
ericu wrote:That doesn't add onto the previous years, im usually good at this but im juggling three projects right now and just cant wrap my head around the mathematical equation.

the interest for the next year has to account for the interest that was already added on from the previous year, for instance.

100$ to start, with 10% interest would come out to 110$ after the first year, i then need it to continue to add interest onto that for however many years the user puts in. so the second year should be 110$ * 10% = 111$ and so on and so on.

I just can't think of how to actually write that as a formula
Sorry ericu, from the your op I thought you had the loop down and you just needed the formula. For loop would have worked nice as well.

Posted: Thu Oct 28, 2010 11:03 am
by godpigeon
Though depending on language, there's a difference in for vs while loops... is the logic going to be used at least once or not ;P

Posted: Fri Oct 29, 2010 8:24 am
by Moonde
godpigeon wrote:Though depending on language, there's a difference in for vs while loops... is the logic going to be used at least once or not ;P
It just depends on the condition. If you know how many times you need to loop then for loop it. If the condition is something like "Moonde is now cool and attractive" and we don't know how many iterations of the loop it's going to take to make this condition true then a while loop works. Of course this condition will never end up being true and we'll end up with an infinite loop but that's beside the point!

Posted: Fri Oct 29, 2010 2:10 pm
by godpigeon
Actually if it was always untrue it'd skip that piece of logic. ;P