Calculate interest

Please, the question below is only what I can do. I need a help.
Calculate compound interest month to month, from the years 2010 to 2011, on the value of the month, chosen by the user.
Calculate:
01.2010- 0.50
02.2010- 0.60
03.2010 - 0.70
04.2010 - 0.80
05.2010 - 0.95
06.2010- 0.67
07. 2010 - 0.45
08.2010- 0.99
09.2010 -1.20
10.2010-0.11
11.2010-0.89
12.2010-0.08

01.2011- 0.70
02.2011- 0.60
03.2011 - 0.90
04.2011 - 0.30
05.2011 - 0.15
06.2011- 0.07
07. 2011 - 0.05
08.2011- 0.01
09.2011- 0.21
10.2011-0.11
11.2011-0.09
12.2011-0.01

#include <iostream>
#include <cstdlib>
#include <math.h>

using namespace std;

int main()
{
double i[]={0.50,0.60,0.70,0.80,0.95,0.67,0.45,0.99,1.20,0.11,0.89,0.08};


double sum,value;

cout<<"number ";
cin>>value;

sum=(value*i[0]/100)+ value;
sum= sum +(value*i[1]/100)+ value;
sum= sum +(value*i[2]/100)+ value;
sum= sum +(value*i[3]/100)+ value;

cout<<"result "<<sum <<endl;
system ("pause");
return 0;
}

Look at using a loop, you very close I think from what I see

for (int i =0; j < size of i(); < j++) //using j as i already in use

then do your sum= stuffs, should be only 1 line.... then win???
Topic archived. No new replies allowed.