You are on page 1of 3

#include<iostream>

using namespace std;

void main_menu();
void see_info ();
void add_info();
void add_member ();
int term();

void main_menu()
{
int n;
cout << " 1. See Information " << endl ;
cout << " 2. Add Information " << endl ;
cout << " 3. Terminate The Program " << endl ;

cout << " Enter Option: " << endl ;


cin >> n ;
cout << " Chosen Option Is: " << n << endl;
if (n == 1)
{
see_info();
}
else if (n == 2)
{
add_info();
}
else if (n == 3)
{
term();
}
else
{
cout<< " Invalid Option " << endl;
}
}

void see_info ()
{
int n;
cout<< " 1. View Member " << endl ;
cout<< " 2. History " << endl;
cout<< " 3. Return To Main Menu " << endl ;

cout << " Enter Option: " << endl ;


cin >> n ;
cout << " Chosen Option Is: " << n << endl;
if (n == 1)
{
add_member();
}
else if (n == 2)
{
cout << " The Chatgaiya Club is one of the most prominent and prestigious
social clubs in Bangladesh. "<< endl ;
cout << " Founded in the year 2019 by Shihab Ar Rashid and Rizwanul
Hassan. " << endl ;
cout << " It is located at Nasirabad, Chittagong, Bangladesh. " << endl ;
main_menu();
}
else if (n == 3)
{
main_menu();
}
else
{
cout<< " Invalid Option " << endl;
}

void add_info()
{
int n;
cout<< " 1. Add Member " << endl ;
cout<< " 2. Return To Main Menu " << endl ;

cout << " Enter Option: " << endl ;


cin >> n ;
cout << " Chosen Option Is: " << n << endl;
if (n == 1)
{
add_member();
}
else if ( n == 2)
{
main_menu();
}
else
{
cout<< " Invalid Option " << endl;
}
}

int term()
{
return 0 ;
}
struct Member
{
string ID;
char name[20];
char add[20];

};

void add_member ()
{
int n,y;
cout << "To Add Press 1 " << endl;
cout << "To View Press 2 " << endl;
cout << "Enter Option " << endl;
cin >> y ;
if (y == 1)
{
cout<< "How Many Members Do You Want To Add? " << endl ;
cin >> n ;
Member m[n] ;
for (int i = 0; i < n ; i++)
{
cout << " Enter ID: " << endl ;
cin >> m[i].ID ;
cout << " Enter Name: " << endl ;
cin >> m[i].name ;
cout << " Enter Address: " << endl ;
cin >> m[i].add ;

}
cout << " Member Successfully Added " << endl ;
}

else if (y == 2)
{

cout<< "How Many Members Do You Want To View? " << endl ;
cin >> n ;
Member m[n] ;
for (int i = 0; i < n; i++ )
{
cout<< " Member ID : " <<m[i].ID<< endl;
cout<< " Member Name : " <<m[i].name<< endl;
cout<< " Member Address : " <<m[i].add<< endl;
}
}

else
{
cout << "Invalid" << endl;
}

main_menu();
}

int main ()
{
cout<< " -------------------------WELCOME TO THE CHATGAIYA
CLUB-------------------------" << endl ;
cout << " Chose An Option " << endl ;
main_menu();

You might also like