Healthcare Membership
// lab4-10.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include
#include
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
const double ADULTRATE = 40.0;
const double CHILDRATE = 20.0;
const double SENIORRATE = 30.0;
int x;
int choice;
int months;
double charges;
cout << " Health Club Membership Menu\n";
cout << "1. Standard Adult Membership\n";
cout << "2. Child Membership\n";
cout << "3. Senior Citizens Membership\n";
cout << "4. Quit the program\n\n";
cout << "Enter a choice: ";
cin >> choice;
cout << fixed << showpoint << setprecision(2);
if (choice == 1)
{ cout << "\nFor how many months? ";
cin >> months;
charges = months * ADULTRATE;
cout << "the total charges are $ " << charges << endl;
}
else if (choice == 2)
{ cout << "\nFor how many months? ";
cin >> months;
charges = months * CHILDRATE;
cout << "The total charges sre $ " << charges << endl;
}
else if (choice == 3)
{ cout << "\nFor how many months? ";
cin >> months;
charges = months * SENIORRATE;
cout << "The total charges are " << charges << endl;
}
else if (choice != 4)
{ cout << "The valid choices are 1-4. Run the\n"
<< "program again and select one of those.\n";
}
cin >> x;
return 0;
}