Can some one tell mw what I am doing wrong with this program?
// C++ Program
// IRA Account
// Author:
// Email Address: [email protected]
// Date: FEB-23-2003
/* This program will compute compound interest for a IRA
with an initial investment of whatever amount in dollar and yielding
at what ever percent interest.Assuming that all interest is left
on deposit in the account from the age 16 to 60 years, and at age 61
you start taking out the monthly interest to live on. You leave the
Accumalated balances alone. How much interestincome would the person
have to live on for each month. */
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
#include <string>
#include <cctype>
#include <iomanip>
using std::setiosflags;
using std::setprecision;
using std::ios;
using std::fixed;
using std::showpoint;
#include <cmath>
using namespace std;
int main () {
double balanceAmount;
double initialAmount;
double interestRate;
char response;
double monthlyInterest;
// int year;
do {
cout << "Hello! This program wil be used to calculate your IRA: \n";
cout << "Please enter the Investment in dollars at age 16: \n";
cin >> initialAmount;
cout << endl;
cout << " Please enter Interest Rate:\n";
cin >> interestRate;
cout << endl;
cout << "Total accumulated at age 60 \n";
cout << "Total accumulated at age 61 \n";
cout << "This is monthly income from interest \n";
for (int year = 1; year <= 50; year++ )
balanceAmount = initialAmount* interestRate;
monthlyInterest = balanceAmount* interestRate * (1 + interestRate)/12;
// cout << setprecision(2) << setiosflags(ios::fixed |
// ios::showpoint) <<balanceAmount << endl;
cout << "would you like to run the program again? (Y/N)/";
cin >> response;
system("cls");
}
while (response=='Y'||response=='y');
cout << "Goodbye. Have a nice day!\n";
char letter;
cin >>letter;
return 0;
}