Hey you programming nerds
Hey you programming nerds
I have to make a program in c++ where the user inputs money he has in the bank, then how many years he chooses and the interest he gets, The interest is compounded annually - so each time through a loop is another year and the interest is calculated and added to the principle for that year. what would the formula I would put in the loop be?
WORLD OF LOGS #1's
Force choking the shit out of bitches!
Force choking the shit out of bitches!
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
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
WORLD OF LOGS #1's
Force choking the shit out of bitches!
Force choking the shit out of bitches!
Just because something is an algorithm doesn't make it math. Writing something that has a machine make a tone at a certain time is an algorithm, but I wouldn't call it math. It's just an instance of human logic being translated into mathematical logic, with the intended resolution's nature hardly being described as mathematical.godpigeon wrote:And how do you get algorithms in programing?... It's math
Interest compounding, on the hand, is an event that is both delineated and elucidated by mathematics. In this case, math is the intended function, and not just an intangible means to an end. Compounding is just a word used to describe variable rate exponential change, be it interest gains or inflation losses.
I wasn't trying to slight your response, just point out that he asked programmers for a math question.