1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
// //The program to evaluate simple interest // #include <cstdio> #include <cstdlib> #include <iostream> #include <string> using namespace std; int main(int nNumberofArgs, char* pszArgs[]) { double total; //Enter the factor double principle; cout << "Enter the amount of money that is in the bank:" << endl; cin >> principle; //Enter the principle double time; cout << "Enter the amount of time your money is in the bank (Months):" << endl; cin >> time; time = time / 12; //enter the rate double rate; cout << "Enter the interest rate:" << endl; cin >> rate; //the math for monthly interest cout << "Starting month: $" << principle << endl; int row = 1; double principle2 = principle; for(int time1 = 1;time1 <= time;time1++) { double pre_total; pre_total = principle2 * rate; principle2 = principle2 + pre_total; total = principle2; cout << "Year " << row << " - $" << total << endl; row++; } double intgained = principle2 - principle; //show results cout << "Here is interest gained: $" << intgained << endl; cout << "Here is your accumulated money after " << time << " years: $" << total << endl; //wait before terminating system ("PAUSE"); return 0; }