By Sayma Naaz
In this packet, the maintenance of the books record in a library has been implemented using C++ programming.
In this packet to implement the book record of the library, two header files have used. These are:
iostream: to handle the input and output.
fstream: to handle the files used in the program.
In the main program, firstly a function named ControlPanel() has been called which displayed the list of features which includes:
1.Add New Books
After that, a message appeared on the screen "Enter your Choice:", to enter the choice from the above six options and to perform this operation switch statement will work which has six cases each case for each option. According to choice cases will work and for every case, the different function will work.
For Case1: AddBooks() function will work in which the program takes some input from the user as Book name, Author name, Book ID and number of Books and add these books in a file named Books and library.
For Case2: DisplayBook() function will work in which the program displays the list of books present in the file named Books or in the library.
For Case3: CheckBook() function will work in which the program takes Book ID as input and return whether the book is present or not in the library. If the book is present then it returns the details of the book otherwise it returns the message "Book Not Found".
For Case4: UpdateBook() function will work in which the program takes Book ID as input and ask to update the book name, author name and no. of copies for this particular book id and update these values if the id is not found it returns the message "Book Not Found".
For Case5: DeleteBook() function will work in which the program takes Book ID as input and delete this book from the library or Books file if the id is not found it returns the message "Book Not Found".
For Case6: Simply exit the program.
Submitted by Sayma Naaz (saymanaaz)
Download packets of source code on Coders Packet