
-----------------------------------
JR
Mon Sep 27, 2004 5:18 pm

Something related to loops i think
-----------------------------------
Well i got this assigment which i have a starting rate of $2500 and i need to program to tell me after how many years the rate will be $5000 if theres a 7.5% compuned annualy.

Heres what i got for now but it doesnt seem to work...



#include 

void main ()
{
float starting_rate;
float percent;
float per;
float years=0;
float final;
starting_rate=2500;
percent=0.075;
while (starting_rate < 5001)
{
per=starting_rate*percent;
final=starting_rate+per;
final=starting_rate;
years=years+1;
if (final=5000)
{
break;
}
}
cout