#include
#include
using namespace std;
class book
{
private :
string book_name;
string book[100];
string author_name;
string author[100];
string publisher_name;
string publisher[100];
int year_of_print;
int year[100];
int choice;
int repeat =1;
int count =0;
public :
void findauthor()
{
int author_book_occurence = 0;
cout<<"Enter the author for which Book is needed"< cin>>author_name;
cout<<"Book belongings To This Author Are: "< for(int i =0;i {
if(author[i] == author_name)
{
cout<<"Book Name "<
author_book_occurence ++;
}
}
if(author_book_occurence > 0)
{
cout<<"Number of Books Present for Author are"<
}
else
{
cout<<"No Book Are Present for this Author "<
}
}
void findpublisher()
{
int publisher_book_occurence = 0;
cout<<"Enter the Publisher for which Book is needed"<
cin>>publisher_name;
cout<<"Book belongings To Publisher "<
for(int i =0;i
{
if(publisher[i] == publisher_name)
{
cout<<"Book Name "<
publisher_book_occurence ++;
}
}
if(publisher_book_occurence > 0)
{
cout<<"Number of Books Present for Publisher are: "<
}
else
{
cout<<"No Book Are Present for this Publisher "<
}
}
void findyear()
{
int year_book_occurence = 0;
cout<<"Enter the Year for which Book is needed"<
cin>>year_of_print;
cout<<"Book belongings To This Year Are: "<
for(int i =0;i
{
if(year[i] == year_of_print)
{
cout<<"Book Name "<
year_book_occurence ++;
}
}
if(year_book_occurence > 0)
{
cout<<"Number of Books Present for this Year "<
}
else
{
cout<<"No Book Are Present for this Year "<
}
}
void add()
{
cout<<"Enter the book Name"<
cin>>book[count];
cout<<"Enter the Author Name"<
cin>>author[count];
cout<<"Enter the Publisher Name"<
cin>>publisher[count];
cout<<"Enter the Year Of Publication "<
cin>>year[count];
cout<<"Book Have Been Added"<
}
void display()
{
cout<<"All the Book Present in the library are"<
for(int i =0;i
{
cout<<"Book Name: "<
}
}
void startmenu()
{
cout<<"Welcome to the Books Part of the Library"<
cout<<"Here You Can Find The Book By Multiple Options"<
do
{
cout<<"To Find By Author Name Press 1"<
cout<<"To Find By Publisher Name Press 2"<
cout<<"To Find By Year Of Publication Press 3"<
cout<<"To View All Books With All the Details Press 4"<
cout<<"To Add A Book Press 5"<
cout<<"To Exit The Book Menu Press 6"<
cin>>choice;
switch(choice)
{
case 1:
{
findauthor();
break;
}
case 2:
{
findpublisher();
break;
}
case 3:
{
findyear();
break;
}
case 4:
{
display();
break;
}
case 5:
{
add();
break;
}
case 6:
{
exit(0);
}
default :
{
cout<<"You have entered wrong option"<
break;
}
}
cout<<"To Try Again for Book Press 1 or Press any other key to Exit"<
cin>>repeat;
count ++;
}while(repeat == 1);
exit(0);
}
};
class Music
{
private :
string sname[100];
string singer_name;
string singer[100];
string composer_name;
string composer[100];
string writer_name;
string writer[100];
int year_of_relase;
int year[100];
int choice;
int repeat =1;
int count =0;
public :
void findsinger()
{
int occurence = 0;
cout<<"Enter the Singer Name for which Song is needed"<
cin>>singer_name;
cout<<"Songs Released By Singer "<
for(int i =0;i
{
if(singer[i] == singer_name)
{
cout<<"Song Name: "<
occurence ++;
}
}
if(occurence > 0)
{
cout<<"Number of Song released by singer are: "<
}
else
{
cout<<"No Song Are Present of this Singer "<
}
}
void findcomposer()
{
int occurence = 0;
cout<<"Enter the Composer Name for which Song is needed"<
cin>>composer_name;
cout<<"Songs Released By Composer are :"<
for(int i =0;i
{
if(composer[i] == composer_name)
{
cout<<"Song Name: "<
occurence ++;
}
}
if(occurence > 0)
{
cout<<"Number of Song released by Composer are "<
}
else
{
cout<<"No Song Are Present of this Composer "<
}
}
void findwriter()
{
int occurence = 0;
cout<<"Enter the Writer Name for which Song is needed"<
cin>>writer_name;
cout<<"Songs Released By Writer "<
for(int i =0;i
{
if(writer[i] == writer_name)
{
...