Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Its C++ Program for Library System Using Data Structures.Following functions are implemented 1) Insert a Book 2) Stock of Book 3) Search of Book by

Its C++ Program for Library System Using Data Structures.Following functions are implemented

1) Insert a Book 2) Stock of Book 3) Search of Book by ISBN 4) Display Books by author 5) Modify a Book record 6) Delete a Book

Add these functions in program

2) Issue a Book to student 3) Book Deposit by students 4) Find all Issued Books

Program : #include #include using namespace std;

class Book { public: string bName; string ISBN; string author; string year_published; string student; string roll; string Class; Book* next; };

Book* head=NULL;

void Insert_book() { Book* new_book=new Book(); Book *last=head;

cout<>new_book->bName; cout<<"Enter the ISBN Number:"; cin>>new_book->ISBN; cout<<"Enter the Authur name:"; cin>>new_book->author; cout<<"Enter the Year Published:"; cin>>new_book->year_published; new_book->next=NULL; if (head==NULL) { head=new_book; } else { while (last->next!=NULL) last=last->next; last->next=new_book; } system ("CLS"); }

void Delete_book() { if(head==NULL) { cout<<"List is empty!!!"; } else { string dISBN; cout<>dISBN; Book *prev=head; Book *current=head; if(current->ISBN==dISBN) { head=head->next; } else { prev=current; current=current->next; while(current->ISBN!=dISBN) { current=current->next; if(current==NULL) break; } if(current!=NULL) { prev->next=current->next; } else { cout<<"Book not found in data"; } } } }

void modify_book() { if(head==NULL) { cout<<"List is empty!!!"; } else { string dISBN; cout<>dISBN; Book *current=head; while(current->ISBN!=dISBN) { current=current->next; if(current==NULL) break; } if(current!=NULL) {

cout<>current->bName; cout<<"Enter the ISBN Number:"; cin>>current->ISBN; cout<<"Enter the Authur name:"; cin>>current->author; cout<<"Enter the Year Published:"; cin>>current->year_published; } else { cout<<"Book is not in data"; } } }

void Searchbookby_ISBN() { if(head==NULL) { cout<<"List is empty!!!"; } else { string dISBN; cout<>dISBN; Book *current=head; while(current->ISBN!=dISBN) { current=current->next; if(current==NULL) break; } if(current!=NULL) { cout<bName; cout<ISBN; cout<author; cout<year_published; cout<

void SearchBy_author() { if(head==NULL) { cout<<"List is empty!!!"; } else { string dauthor; cout<>dauthor; Book *current=head; while(current->author!=dauthor) { current=current->next; if(current==NULL) break; } if(current!=NULL) { cout<bName; cout<ISBN; cout<author; cout<year_published; cout<

void Display_ALL_Books() { string enter; if(head==NULL) { cout<<"List is empty!!!"; } else { Book *current=head; while(current!=NULL) { cout<bName; cout<ISBN; cout<author; cout<year_published; cout<next; } } cout<<"Press any key to go main menu"; cin>>enter; system ("CLS"); } void Exit() { cout<

int main() { while(1) { cout<<"\t Main MENU"<>choice; switch(choice) { case 1:Insert_book(); break; case 2:Delete_book(); break; case 3:modify_book(); break; case 4:Searchbookby_ISBN(); break; case 5:SearchBy_author(); break; case 6:Display_ALL_Books(); break;

case 10:Exit(); break;

default:cout<<"Wrong Choice. Select again"<

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions