Hello. I have to write a program for compound monthly interest with a starting monthly deposit, an annual interest rate, and a new balance. My problem is that I cant seem to get the right output. I tried some recommendations but nothings working. I am a complete noob at this. Any and all help would be appreciated.
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double result = 0.0, rate = 0, dollars;
int months = 12, result;
result = dollars * pow( ( 1 + rate / months ) , ( months * dollars ) );
cout << "Enter monthly deposit:" <<endl;
cin >> dollars;
cout << "Enter the interest rate (in percent):" <<endl;
cin >> rate;
cout << "Enter the time (months):" <<endl;
cin >> months;
while (dollars < lastNumber)
{
}
cout << "The new balance is: " << sum + lastNumber<< endl;
return 0;
}
For this I had to use a template (sum.cpp) which can be found here for the reference (under labs and assigns #1)
http://people.stfx.ca/mvanbomm/cseng/