// Includes
#include "stdafx.h"
#include <iostream>
#include <conio.h>
usingnamespace std;
// Main Function
int main()
{
int year;
int charge;
float percent;
double totalamt;
cout << "This program will display projected rates for the next six years.\n\n";
cout << "Enter the yearly charge of the country club: $";
cin >> charge;
cout << "Enter the percentage fee for each year (ex. 4% = .04): ";
cin >> percent;
cout.setf(ios_base::fixed, ios_base::floatfield);
cout.precision(2);
cout << "\n\n";
cout << "Year and Total Amount" << endl;
for (year = 1; year <= 6; year++)
{
totalamt = (charge * percent) + charge;
cout << year << " = " << totalamt << endl;
}
_getch();
return 0;
}
I am having trouble, everything seems ok, but i for some reason cannot get the fee percent charge to add every year. When i run the program all the amounts are
$2600, it suppose to add the percent fee every year for the next 6 years.
Can anyone else see what im doing wrong, i cant figure it out.