#include using namespace std; int main() { // input like // 125 5.5 // compute amount earned at 5.5% interest, // depositing $125 each year, for 10 years // deposit money at beginning of year // get input int deposit, years; double rate, total; cin >> deposit >> rate; // initialize years = 0; total = 0; while ( years < 10 ) { // compute deposit and interest total = (total + deposit) * (1.0 + rate / 100.0); years++; } cout << total; return 0; }