1)
Homework then. Purpose of homework is to learn by doing |
Its not homework. I am doing it because i saw it as a project on some website.But i do understand what you are trying to say.
2)
You are creating a database within the C++ program. You must have some vision about how to do it. |
I am creating the database by using fstream class. I will create one file each for each book entered in the library by the librarian.
3)
How are you storing multiple books now? |
I am using a structure of book, like so:
1 2 3 4 5 6 7
|
struct book
{
string name;
string author;
string id;
int qty
}bk[1000];
| |
So i will store the name of the first book by using bk[0].name. Get it?
4)
Why is there an book ID? What will it be used for? |
The book id is there, so that the librarian can issue the correct book to the student. In case there are two books with the same name but differing by the year of publication, then the librarian can differentiate between them.
5)
What are the "management operations" that you have to implement? |
I librarian can:
a. Add a student to the library(1 year subscription)
b. Remove a student from the library(if subscription not renewed)
c. Add a book to the library.
d. Remove a book from the library.
e. Issue a book to a student.
f. Return a book(by the student).
When the librarian is issuing a book i want him/her to be able to search the book by any substring that forms a part of the book's name, author,year,edition.
And i will return multiple entries with their book name, author name and book id.
Then i will ask the librarian one final time for the book code of the book. And thus i will issue that book with the matching book id.
6)
Spoon-feeding code does not help much in the process; it actually makes things worse (IMHO). |
Thanks for the tip. I am new to c++ and am trying out a lot of new ways of learning to code, and to make the learning process interesting.