Which STL container should I use for a book inventory program?
I was thinking a vector. I plan to implement a query class and menu class. The query class will sort the list based on the given criteria for instance author name. I also want to allow the user to input some bool functions for instance if price is the search criteria the user could enter: >$10.00 and it would list books whose value is greater than $10.00.
I have a book class
I want to allow for multiple authors any suggestions? This is a complicated project for me so I will be asking many questions as I go.Code:#ifndef BOOK_H #define BOOK_H #include <string> class Book{ friend ostream &operator<<(ostream&,const Book &); public: Book(); // constructor title,author,publisher,copy right,isbn,price // used for string literals in constructor Book(string,string="",string="",int=0,int=0,double=0.0); string get_title() const {return title;); string get_author() const {return author;}; string get_publisher() const {return publisher;}; int get_ISBN() const {return isbn;}; int get_datecopyright() const {return datecopyright;}; double get_price() const {return price;}; void set_title(string); void set_author(string); void set_publisher(string); void set_ISBN(int); void set_datecopyright(int); void set_price(double); private: string title; string author; // parsed from authors full name string authorfirstname; string authorlastname; string publisher; int datecopyright; int isbn; int barcode; double price; //split authors fullname into first, last void parse_name(string,string &,string &); }; #endif



LinkBack URL
About LinkBacks


