Hello all, I am trying to figure out how to make my program do the following(it's a table):
The user enters a beginning amount and interest rate.
The year, beginning amount, interest and end amount are all supposed to keep increasing until the end amount is doubled of the beginning amount(in this case 2000).
Here is what I have so far:
void main()
{
cout << setiosflags (ios :: fixed | ios :: showpoint);
cout << setprecision(2);
int amount, endamount = 0, year = 1;
float interest, interest1;
cout << "Enter investment amount: ";
cin >> amount;
cout << "Enter an interest rate: ";
cin >> interest;
cout << "\n";
cout << setw(28) << "Beginning of Year Amount" << setw(16) << "Interest" << setw(32) << "End of Year Amount" << endl;
while (endamount < 2000)
{
endamount += amount;
interest1 = (interest / 100) * amount;
endamount = amount + (interest / 100) * amount;
cout << setw(15) << amount << setw(27) << interest1 << setw(26) << endamount << endl;
}
system("pause");
}