C++ HEALTH CLUB MEMBER SHIP MENU

Posted on at


#include<iostream>
using namespace std;
void main()
{
    int choice, months, pass = 52452, pass1, choice1;
    float charges, adt = 40, ch = 20, sn = 30;
    do
    {
        cout << "\n\t\tHealth Club Member ship menU.......\t\t Tk.\n\n";
        cout << "1. Standard adult membership\n";
        cout << "2. Child membership\n";
        cout << "3. Senior citizen membership\n";
        cout << "4. Change the rates\n";
        cout << "5. Quit the programe\n\n";
        cin >> choice;
        if (choice != 5)
        {
            switch (choice)
            {
            case 1:
                cout << "For how many months?";
                cin >> months;
                charges = months + adt;
                cout << "The total charges are $";
                cout << charges << endl;
                break;
            case 2:
                cout << "For how many months?";
                cin >> months;
                charges = months + ch;
                cout << "The total cahrges are $";
                cout << charges << endl;
                break;
            case 3:
                cout << "For how many months?";
                cin >> months;
                charges = months + sn;
                cout << "The total charges are $";
                cout << charges << endl;
                break;
            case 4:
                if (choice = 4)
                    cout << "Correct Password Required....\nEnter the password/n" << endl;
                cin >> pass1;
                if (pass1 == pass)
                {
                    cout << "For change in adult press 1" << endl;
                    cout << "For change in child press 2" << endl;
                    cout << "For change in senior citizen press 3" << endl;
                    cin >> choice1;
                    if (pass1 == pass)
                    {

                        if (choice1 == 1)
                        {
                            cout << "Set the rate of adult";
                            cin >> adt;
                        }
                        else if (choice1 == 2)
                        {
                            cout << "Set the rate of child";
                            cin >> ch;
                        }
                        else if (choice1 == 3)
                        {
                            cout << "Set the rate of senior citizen";
                            cin >> sn;
                        }
                        else
                            cout << "Invalid numbers"<<endl;
                        cout << "Changes Has Been Made...."<<endl;
                    }
                    else cout << "Invalid password\nPlease enter the correct password" << endl;
                }
            case 5: cout << "Thanks for using this";
                cout << "program.\n";
                break;
            default:
                cout << "The valid choices are 1-4.";
                cout << "Try again.\n";
            }
        }

    } while (choice != 5);
cout<<"\t\tProgramm Developed BY SHAH G ........";    
system("pause");
    
}

 

 

 

this is a programe which shows the menu of health club member ship.

when user enter any number 1,2,3, it show his criteria to how many months you want to apply and then multiply months and RS to give you total of yours.I put also a gud thing which is password if user wants to change the rates after some months or years so yo press 4 and then he ask you "enter the pssword to change the rates" its a good thing because if i did't give that password then every one will be abel to change the password.

 

thanxx for watching and ENJOY....

 



About the author

saad-ali-shah

I am Arsalan.M and i am study in college , i am from punjab but i spent chilhood in karachi and now i am came islamabad to study.

Subscribe 0
160