Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

For your Mid-Term Exam, you will be creating a Menu-Driven application to keep track of a home "library". The library will include books, videos, and music (at a minimum - you may have other things...

1 answer below »
For your Mid-Term Exam, you will be creating a Menu-Driven application to keep track of a home "li
ary".  The li
ary will include books, videos, and music (at a minimum - you may have other things you want to keep track of).  Each of these may have different/multiple media options, such as Hardback, Pape
ack (may be further
oken into Trade, Mass Market, Comic?), eBook, Blu-Ray, DVD, MP4, MP3, CD, etc... You might have the same Title as Hardback, Pape
ack, and eBook (I have some of these).  You may have the item additionally as a movie or a soundtrack, so you may have multiple "copies" of the same title.  
Some items may be parts of series or even sub-series. Star Trek for example, you have the original TV show and Movies, Next Gen TV show & movies, New Timeline Movies, all the Spin-off shows (Voyager, etc), and even books.
Another example is Star Wars - you have 9 movies in the main story, plus the side-stories.  Each "trilogy" of movies is it's own sub-series. Again, there are books in the series.
Music comes in albums, singles, and other options.  You may wind up with the same song multiple times.
Each item may belong to multiple genres.  There may also be multiple authors, actors, artists.
Answered Same Day Mar 30, 2021

Solution

Aditya answered on Mar 30 2021
158 Votes
#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"
endl;
cin
author_name;
cout
"Book belongings To This Author Are: "
endl;
for(int i =0;i {
if(author[i] == author_name)
{
cout
"Book Name "
ook[i]
endl;
author_book_occurence ++;
}
}
if(author_book_occurence > 0)
{
cout
"Number of Books Present for Author are"
author_book_occurence
endl;
}
else
{
cout
"No Book Are Present for this Author "
endl;
}
}
void findpublisher()
{
int publisher_book_occurence = 0;
cout
"Enter the Publisher for which Book is needed"
endl;
cin
publisher_name;
cout
"Book belongings To Publisher "
publisher_name
" are :"
endl;
for(int i =0;i {
if(publisher[i] == publisher_name)
{
cout
"Book Name "
ook[i]
endl;
publisher_book_occurence ++;
}
}
if(publisher_book_occurence > 0)
{
cout
"Number of Books Present for Publisher are: "
publisher_book_occurence
endl;
}
else
{
cout
"No Book Are Present for this Publisher "
endl;
}
}
void findyear()
{
int year_book_occurence = 0;
cout
"Enter the Year for which Book is needed"
endl;
cin
year_of_print;
cout
"Book belongings To This Year Are: "
endl;
for(int i =0;i {
if(year[i] == year_of_print)
{
cout
"Book Name "
ook[i]
endl;
year_book_occurence ++;
}
}
if(year_book_occurence > 0)
{
cout
"Number of Books Present for this Year "
year_book_occurence
endl;
}
else
{
cout
"No Book Are Present for this Year "
endl;
}
}
void add()
{
cout
"Enter the book Name"
endl;
cin
ook[count];
cout
"Enter the Author Name"
endl;
cin
author[count];
cout
"Enter the Publisher Name"
endl;
cin
publisher[count];
cout
"Enter the Year Of Publication "
endl;
cin
year[count];
cout
"Book Have Been Added"
endl;
}
void display()
{
cout
"All the Book Present in the li
ary are"
endl;
for(int i =0;i {
cout
"Book Name: "
ook[i]
" Book Author: "
author[i]
" Book Publisher: "
publisher[i]
" Year Of Print: "
year[i]
endl;
}
}
void startmenu()
{
cout
"Welcome to the Books Part of the Li
ary"
endl;
cout
"Here You Can Find The Book By Multiple Options"
endl;
do
{
cout
"To Find By Author Name Press 1"
endl;
cout
"To Find By Publisher Name Press 2"
endl;
cout
"To Find By Year Of Publication Press 3"
endl;
cout
"To View All Books With All the Details Press 4"
endl;
cout
"To Add A Book Press 5"
endl;
cout
"To Exit The Book Menu Press 6"
endl;
cin
choice;
switch(choice)
{
case 1:
{
findauthor();

eak;
}
case 2:
{
findpublisher();

eak;
}
case 3:
{
findyear();

eak;
}
case 4:
{
display();

eak;
}
case 5:
{
add();

eak;
}
case 6:
{
exit(0);
}
default :
{
cout
"You have entered wrong option"
endl;

eak;
}
}
cout
"To Try Again for Book Press 1 or Press any other key to Exit"
endl;
cin
epeat;
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"
endl;
cin
singer_name;
cout
"Songs Released By Singer "
singer_name
" are :"
endl;
for(int i =0;i {
if(singer[i] == singer_name)
{
cout
"Song Name: "
sname[i]
endl;
occurence ++;
}
}
if(occurence > 0)
{
cout
"Number of Song released by singer are: "
occurence
endl;
}
else
{
cout
"No Song Are Present of this Singer "
endl;
}
}
void findcomposer()
{
int occurence = 0;
cout
"Enter the Composer Name for which Song is needed"
endl;
cin
composer_name;
cout
"Songs Released By Composer are :"
endl;
for(int i =0;i {
if(composer[i] == composer_name)
{
cout
"Song Name: "
sname[i]
endl;
occurence ++;
}
}
if(occurence > 0)
{
cout
"Number of Song released by Composer are "
occurence
endl;
}
else
{
cout
"No Song Are Present of this Composer "
endl;
}
}
void findwriter()
{
int occurence = 0;
cout
"Enter the Writer Name for which Song is needed"
endl;
cin
writer_name;
cout
"Songs Released By Writer "
writer_name
" are :"
endl;
for(int i =0;i {
if(writer[i] == writer_name)
{
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here