#include #include //for the "i/o manipulators" setw and setprecision #include using namespace std; int main() { double principal {300.00}; //start with this many dollars cout<< "What is the principle?\n"; cin>> principal; int nyears {0}; cout << "How many years?\n"; cin >> nyears; double rate {0}; cout<< "What is he interest rate?\n"; cin>> rate; double factor {1.00 + 0.01 * rate}; cout << "year principal\n" //column headings << "---- ----:-----\n"; for (int year {1}; year <=nyears; ++year) { principal *= factor; cout << setw(4) << year << " $" << fixed << setprecision(2) << principal << "\n"; } return EXIT_SUCCESS; }