fork download
  1. // Castulo Jason Quintero CSC5 Chapter 5 homework, pg. 294 #5
  2. //
  3. /**************************************************************************
  4.  * Display Membership Fee Increase
  5.  * ________________________________________________________________________
  6.  * This program computes and displays fee increase for a
  7.  * country club over the next six years
  8.  * ________________________________________________________________________
  9.  * INPUT
  10.  * YEARLY_CHARGE : Fee charge per year
  11.  * INCREASE : Fee Increase per year
  12.  *
  13.  * OUTPUT
  14.  * total : Yearly total of fee and price increase
  15.  *
  16.  *
  17.  *************************************************************************/
  18. #include <iostream>
  19. #include <iomanip>
  20. using namespace std;
  21.  
  22. int main()
  23. {
  24. // variables
  25. const float YEARLY_CHARGE = 2500, // Yearly fee
  26. INCREASE = 0.04; // Yearl Increase
  27. float total = YEARLY_CHARGE;
  28.  
  29.  
  30. cout << "Yearly membership fee increase" << endl;
  31. cout << "------------------------------" << endl;
  32.  
  33.  
  34. // for loop to display increase
  35. for (int i = 0; i < 6; i++)
  36. {
  37. cout << "Year " << i+1 <<": " << "\t\t\t\t $"<< total << endl;
  38. total += (YEARLY_CHARGE * INCREASE);
  39. } // end of for loop
  40.  
  41.  
  42. return 0;
  43. }
Success #stdin #stdout 0s 5300KB
stdin
Standard input is empty
stdout
Standard output is empty