fork download
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. double starting;
  8. double increasePCT = 0.04;
  9.  
  10. starting = 2500;
  11.  
  12. cout << fixed << setprecision(2);
  13. for (int i = 1; i <= 6 ; i++)
  14. {
  15. cout << "The membership rate on the year num : " << i ;
  16. cout << " is $" << starting << endl;
  17.  
  18. starting += starting * increasePCT;
  19. }
  20. // your code goes here
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
The membership rate on the year num : 1 is $2500.00
The membership rate on the year num : 2 is $2600.00
The membership rate on the year num : 3 is $2704.00
The membership rate on the year num : 4 is $2812.16
The membership rate on the year num : 5 is $2924.65
The membership rate on the year num : 6 is $3041.63