Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Build a data base for books in library For each book you would like to have following information Book name: Subject: ( possible values eng,math,arts

Build a data base for books in library

For each book you would like to have following information

Book name:

Subject: ( possible values eng,math,arts etc.)

Year: Author:

Available: Yes/No

The book database will grow over the years so use binary file reading/writing to read old information/store new.

Your software should have Following functionalities o Read data from file if there are already some books information there

o Add new book

o Search

o Remove a book

o Save latest books

Note: Make a structure for type book for ease of implementation and also it's mandatory for this project. Following are the implementation details for your software:

1. The maximum number of books your software will support is 100. Use int type no_of_books counter to keep track of number of books currently in your database

. 2. First Initialize no_of_books and array of books by reading it from binary file. Please note that when you are running your code for first time, there is no such binary file to read. So initiallize your variables accordingly.

3. Then ask user which operation to perform.

Add

Search

Modify

Delete

Save

a) Add: Enter new book information by taking input from console and increment No_of_books counter.

b) Search: User want to search for a particular book. Ask user by which criteria he/she want to search

i. By name

ii. By author name

iii. By Subject Depending on the search criteria, take user input and search. if the match is found display all book information otherwise repeat step

b). There could be multiple books that matches the search input then display all these books information.

c) Modify: certain book information. Similarly as step 3

b) ask user which book information he/she want to modify. Once the required book is found or there could be multiple books. Ask user to enter new information for each searched book or if he/she wants to keep the old information

. d) Delete: Ask user for book name to delete. Then find first index of that book and replace it with last book in the array and decrement no_books_counter

. e) Save: Store latest information in binary file . Thats No_of_books and array of books. After any operation e.g. Add, Search, Modify etc. your code should not exit instead it should keep running and go back to step

3. Your code should only exit when Save option is selected. Hint: Use while(1) loop and break in Save.

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

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions