C++/how to make a project of library
Expert: vijayan - 9/24/2008
Questionsir i want to make a program of library where i want following points to be included:
1.store the name of books available.
2.store the name of students and have a library card number
3.when a student comes and ask for a book we will search in library books and give him if available
4.date of issue should be stored and there should be a date of reissue .
5.if a student do not returns or reissue it within a given time he/she should be imposed fine.
Answerimplement the classes:
date - keep a calendar date eg. 12 june 2009
title - the book title eg. Ruminations on C++
copy - a copy of a particular title (one title can have many copies)
student - a library member.
class date
{
// ...
};
class title
{
public :
// public functions
private :
std::string book_name ;
std::string author ;
std::string isbn ;
std::vector<book*> copies;
// other members
};
class copy
{
public :
// public functions
private :
int book_number ;
title* the_title ;
student* issued_to ;
date issue_date ;
date due_date ;
// other members
};
class student
{
public :
// public functions
private :
std::string name ;
int card_number ;
std::vector<book*> borrowed_books ;
// other members
};
have two lookup tables one mapping isbn number to the title object,
the other mapping library card number to student object.
std::map< std::string, title* > isbn_title_map ;
std::map< int, student* > card_student_map ;
now, put it all together in a program, with functions to
issue books, return books, calculate fine etc.