int member_count=3;
int *pmember_count=&member_count;
string member_name[15]={"bajwa","shafiq","aqib rehman"};
string membership_numb[15]={"1","2","3"};
string contact_numb[15]={"0311123456","0312123456","0313123456"};
int book_count=7;
int *pbook_count=&book_count;
string book_name[15]={"calculas","physics","computer programming","english","linear algebra","sociology","ITC"};
string book_numb[15]={"001","002","003","004","005","006","007"};
string auth_name[15]={"Thomus Finny","Haliday Risnik","Adnan khalid","Arif khattak","Dure Sharwar","Aisha Akbar","Tazina Malik"};
//........................Start of Main.....................
void main()
{
system("CLS");
int choice;
cout<<"\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<" ( Library Management System ) \n ";
cout<<"\t\t\t\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<"\n\t\t\t\t\6 Well Come \6\n";
cout<<"\n\t\t\t\t Main Menu\n\n";
cout<<" 1 to view\n\n";
cout<<" 2 to insert\n\n";
cout<<" 4 to exit\n\n";
cout<<"\n enter any opotion from above\n\n";
cin>>choice;
switch(choice)
{
case 1:
{ view();
break;}
case 2:
{insert();
break;}
case 4:
{'stop';
break;}
default:
{cout<<"Invalid\n";
main();
break;}
}
}
//..............................End of Main.......................
int choice;
cout<<"\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<" ( Library Management System ) \n ";
cout<<"\t\t\t\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<"\n\t\t\t\t\6 Well Come \6\n";
cout<<"\n\t\t\t\t View Menu\n\n";
cout<<" 1 to view books in library\n\n";
cout<<" 2 to view member details\n\n";
cout<<" 4 to go back to Main Menu\n\n";
cout<<"\n enter any opotion from above\n\n";
cin>>choice;
switch(choice)
{
case 1:
{view_books();
break;}
case 2:
{view_member_details();
break;}
case 4:
{main();
break;}
}
}
void insert()
{
system("CLS");
int choice;
cout<<"\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<" ( Library Management System ) \n ";
cout<<"\n\t\t\t\t\6 Well Come \6\n";
cout<<"\n\t\t\t\t Insert Book Menu\n\n";
cout<<" 1 to insert books in library\n\n";
cout<<" 2 to insert member details\n\n";
cout<<" 3 to go back to Main Menu\n\n";
cout<<"\n enter any opotion from above\n\n";
cin>>choice;
switch(choice)
{
case 1:
{insert_book();
break;}
case 2:
{insert_member_details();
break;}
case 3:
{main();
break;}
}
}
void view_books()
{
system("CLS");
char choice;
cout<<"\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<" ( Library Management System ) \n ";
cout<<"\t\t\t\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<"\n\t\t\t\t\6 Well Come \6\n";
cout<<"\n\t\t\t\t Books Detail\n\n";
for(int i=0;i<*pbook_count;i++)
{
cout<<"Book Number\t"<<book_numb[i]<<endl;
cout<<"\nBook Name\t"<<book_name[i]<<endl;
cout<<"\nAuther Name\t"<<auth_name[i]<<endl<<endl<<endl;
}
cout<<"\n\nenter c to goback to the view menu"<<endl;
cout<<"\t enter any to goto the Main Menu\n";
cin>>choice;
if(choice=='c' ||choice=='C')
{
view();
}
else{main();}
}
void view_member_details()
{
system("CLS");
char choice;
cout<<"\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<" ( Library Management System ) \n ";
cout<<"\t\t\t\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<"\n\t\t\t\t\6 Well Come \6\n";
cout<<"\n\t\t\t\t Member Details \n\n";
for(int i=0;i<*pmember_count;i++)
{
cout<<"Member Number\t" <<membership_numb[i]<<endl;
cout<<"\nMember Name\t " <<member_name[i]<<endl;
cout<<"\nMember Contact Number\t" <<contact_numb[i]<<endl<<endl<<endl;
}
cout<<"\n\nenter c to goback to the view menu"<<endl;
cout<<"\t enter any to goto the Main Menu\n";
cin>>choice;
if(choice=='c' ||choice=='C')
{
view();
}
else{main();}
}
void insert_book()
{
system("CLS");
char choice;
cout<<"\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<" ( Library Management System ) \n ";
cout<<"\t\t\t\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<"\n\t\t\t\t\6 Well Come \6\n";
cout<<"\n\t\t\t\t Insert book Details \n\n";
do{
cout<<"Enter Book Name..\t\20\t"<<endl;
cin>>book_name[*pbook_count];
cout<<"Enter Book Number..\t\20\t"<<endl;
cin>>book_numb[*pbook_count];
cout<<"Enter Auther Name..\t\20\t"<<endl;
cin>>auth_name[*pbook_count];
cout<<"do you want to add another book?"<<endl;
cout<<"\n\t enter y for yes n for no\n";
cin>>choice;
*pbook_count++;
if(choice=='n' ||choice=='N')
{insert();}
}
while(choice=='y' ||choice=='Y');
}
void insert_member_details()
{
system("CLS");
char choice;
cout<<"\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<" ( Library Management System ) \n ";
cout<<"\t\t\t\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\n";
cout<<"\n\t\t\t\t\6 Well Come \6\n";
cout<<"\n\t\t\t\t Insert member Details \n\n";
do{
cout<<"Enter Member Name..\t\20\t"<<endl;
cin>>member_name[*pmember_count];
cout<<"Enter Member Number..\t\20\t"<<endl;
cin>>membership_numb[*pmember_count];
cout<<"Enter Contact number..\t\20\t"<<endl;
cin>>contact_numb[*pmember_count];
cout<<"do you want to add another member?"<<endl;
cout<<"\n\t enter y for yes n for no\n";
cin>>choice;
*pmember_count++;