hello
I am just for fun going to try to code a program for saving monny in a bank.
I am going to save 1000,- pr month in my saving account.
Intrest:
0 - 50000 = 2.2%
50000- 200000 = 3.2%
200000 - 500000 = 4.9%
For 40 years.
CODE
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
double input, mnd, total;
double delsum;
double sum;
double intrest=2.2;
input=1000;
for(mnd=12; mnd<=480; mnd++)
{
delsum= (input*mnd*intrest)/100; //this is intrest pr year.
total= delsum+(input*mnd);
cout<<total << "\n";
}
system("PAUSE");
return EXIT_SUCCESS;
}
This is not all the program, but this loop do not give me the right answer.
I have solved this in MS Excel and the ansver is 768 522,58,- this is with intrest of 2.2 for 40 years.
Can annyone help to direct me going the right way?
Thanks
MrOizO