Here's my code... i put in some troubleshooting couts, but I can't figure out what's going on.
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
int main()
{
const double INT_RATE = 0.10 ;
const double FACTOR = 1.0 * INT_RATE ;
const int START_AGE = 16 ;
const int STOP_AGE = 60 ;
int age ;
double begPrin ;
double newPrin ;
double newPrin1 ;
double intP1 ;
double monPay ;
ofstream outFile ;
cout << "Beginning Principle: " << flush ;
cin >> begPrin ;
cout << endl << endl ;
cout << begPrin << endl << endl ;
newPrin = begPrin ;
cout << newPrin ;
for ( age = START_AGE ; age <= STOP_AGE ; age++ )
newPrin *= (1.0 + INT_RATE) ;
cout << endl << endl << endl << newPrin ;
intP1 = newPrin1 - newPrin ;
monPay = intP1 / 12 ;
newPrin1 = newPrin * FACTOR ;
cout << fixed << showpoint << setprecision(2) ;
outFile << fixed << showpoint << setprecision(2) ;
cout << "The initial investement was $" << begPrin << ". The total amount accumulated after "
<< STOP_AGE - START_AGE << " years, if $" << begPrin << " is allowed to compound with an intereste of "
<< INT_RATE * 100 << "%, comes to $" << newPrin << "." << endl << endl ;
cout << "The total amount accumulated after " << (STOP_AGE - START_AGE) + 1 << " (years + 1) years, if $"
<< begPrin << " is allowed to compound with an interest of " << INT_RATE * 100 << "%, comes to $"
<< newPrin << endl << endl ;
cout << "The intereste earned during this year is $" << intP1 << ". If interest is withdrawn each year thereafter, your income is $" << monPay << " per month." << endl << endl ;
outFile.open(" wishfulthinking.txt ") ;
outFile << "The initial investement was $" << begPrin << ". The total amount accumulated after "
<< STOP_AGE - START_AGE << " years, if $" << begPrin << " is allowed to compound with an intereste of "
<< INT_RATE * 100 << "%, comes to $" << newPrin << "." << endl << endl ;
outFile << "The total amount accumulated after " << (STOP_AGE - START_AGE) + 1 << " (years + 1) years, if $"
<< begPrin << " is allowed to compound with an interest of " << INT_RATE * 100 << "%, comes to $"
<< newPrin << endl << endl ;
outFile << "The intereste earned during this year is $" << intP1 << ". If interest is withdrawn each year thereafter, your income is $" << monPay << " per month." << endl << endl ;
return 0 ;
}