/* Membership Fees Increase - A country club, which currently charges $2,500 per
year for membership, has announced it will increase its membership fee by 4%
each year for the next 6 years. This program uses a loop to display the
projected rates for the next six years. */
#include "Utility.h"
int main()
{
/* Constants: Membership fee */
const double MEMBERSHIP_FEE = 2500.00;
/* Variable: Years (counter variable), Increase, Projected rate */
int years = 1;
double increasePct = .04;
double projectedRate = 0;
/* Display: Form Letter, Table header */
cout << "Valued Sunnydale Country Club Member,\n\n"
<< "I would like to inform you, that our board of directors has decided\n"
<< "to increase the membership fees, currently $2.500, at a rate of 4%\n"
<< "during the next 6 years. You will find a review of the projected\n"
<< "increase in the addendum to this mail.\n\n"
<< "Thank you for your understanding and your loyalty,\n"
<< "Sincerely Yours,\n"
<< "Mori, Yuki\n\n";
cout << "Projected Increase of Membership Fees\n\n"
<< "Year: " << "\t\t% \t\t" << " total $: \n"
<< "-----------------------------------------\n";
/* Do while loop: Loop, while years is lower or equal to years (6) */
do
{
/* Calculation: 2,500 + (2,500 * 4% = 100) * years (6) */
projectedRate = MEMBERSHIP_FEE + (MEMBERSHIP_FEE * increasePct) * years;
/* Display: Formatted output of projected increase */
cout << fixed << showpoint << setprecision(2);
cout << years << "\t\t" << setw(5) << right << ((increasePct * years) * 100)
<< "\t\t " << projectedRate << endl;
years++;
} while (years <= 6);
pauseSystem();
return 0;
}
Wednesday, December 7, 2016
Programming Challenge 5.5 - Membership Fees Increase
Subscribe to:
Post Comments (Atom)
I'm here to share my testimony of what a good trusted loan company did for me. My name is Nikita Tanya, from Russian and I’m a lovely mother of 3 kids I lost my funds on trying to get a loan it was so hard for me and my children, I went online to seek for a loan assistance all hope was lost until one faithful day when I met this friend of mine who recently secured a loan from a very honest man Mr, Benjamin. She introduced me to this honest loan officer Mr, Benjamin who helped me get a loan in within 5 working days, I will forever be grateful to Mr Benjamin, for helping me get back on feet again. You can contact Mr Benjamin via email: 247officedept@gmail.com they do not know I’m doing this for them, but i just have to do it because a lot of people are out there who are in need of a loan assistance please come to this honest man and you can be save as well .WhatsApp:(+1 989-394-3740)
ReplyDelete