#include #include #include using namespace std; int main() { double rate {0.0}; double principal {0.0} double annual rate {0.0} int years {0} cout << "what is the Principal?\n"; cin >> Principal; if (!cin) { cerr << "Sorry, that wasn't an acceptable number.\n"; return EXIT_FAILURE; } cout << "For how many years\n"; cin >> years; if (!cin) { cerr << "Sorry, that wasn't a number.\n; return EXIT_FAILURE; } cout << "What is the annual rate\n"; cin >> annual rate; if (!cin) { cerr << "Sorry, that wasn't an acceptable number.\n"; return EXIT_FAILURE } for (int year {1}; year <= 10; ++year) { principal *= 1.00 + .01; cout << setw(4) << year << " $' << fixed << setprecision(2) << principal << "\n"; } return EXIT_SUCCESS; }