fork download
  1. //OrinTill Qimid CS1A Chapter 4, P. 294, 4
  2. //
  3. /**************************************************************
  4.  * Compute Percent increase
  5.  *
  6.  * ____________________________________________________________
  7.  * This program shows the increase in membership in the next 6 years by the rate of 4 percent per year
  8.  * ____________________________________________________________
  9.  * INPUT
  10.  * Increase : the percent increase
  11.  * OUTPUT
  12.  * total_charge : the increase over the next 6 years.
  13.  **************************************************************/
  14. #include <iostream>
  15. #include <iomanip>
  16. #include <cmath>
  17. using namespace std;
  18.  
  19. int main()
  20. {
  21. float total_charge = 24000,
  22. increase = 1.04;
  23.  
  24. for (float years = 1; years <= 6; years++)
  25. {
  26. total_charge *= increase;
  27. cout<<"In year "<< years<<" The membership fees would be "<< total_charge<<endl;
  28. }
  29.  
  30.  
  31.  
  32.  
  33.  
  34. return 0;
  35. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty