#include #include #include using namespace std; int main() { double principal; int years; double rate; cout << "Enter the initial investment amount: $"; cin >> principal; cout << "Enter the number of years: "; cin >> years; cout << "Enter the annual interest rate (in percent): "; cin >> rate; rate /= 100; cout << "\nyear principal\n" << "---- ---------\n"; for (int year {1}; year <= years; ++year) { principal *= (1 + rate); cout << " " << setw(2) << year << " $" << fixed << setprecision(2) << principal << "\n"; } return EXIT_SUCCESS; }