#include "stdafx.h"
#include <iostream>
usingnamespace std;
int main(double total)
{
float charge , fee;
cout << "This displays the membership increse for the next 6 years.\n\n";
cout.setf(ios_base::fixed , ios_base::floatfield);
cout.precision(2);
cout << "Enter membership charge: $";
cin >> charge;
cout << "Enter membership fee percent in decimal form: ";
cin >> fee;
cout << "\n\n";
for (int x = 1 ; x <= 6 ; x++)
{
total = (charge * fee) + charge;
cout << x << " = " << total;
cout << endl;
}
cout << endl << "Press ENTER to exit...";
cin.clear();
cin.sync();
cin.get();
return 0;
}
I always seem to have trouble with these type of problems.
When the user enter a membership charge and a fee in decimal form, so if the
user enters 2500 as charge and .04 as fee, the total needs to go up for every year, so 2500 and .04 would be
year 1 2600
then year 2 should start at 2600 then go up.
im having trouble getting the year 2 to start at the total of year one, etc all the way up to year 6.
let me know if i need to explain it better, im not a very good speaker, when it comes to explaining a problem.
yeah i just moved that down i had to make it a double total = 0 in order for it to work, but i still need the total problem fixed.
example:
the users enters 2500 and .04
it should display
1 = total
but then i need the total to pick up from year 1 and do the process again all the way to year 6, when i run this program now i get 2600 for every year, judging by the way this is going the correct result should be.