文字版
1.Write a program to build your book library My_library. The book should has name, pages and so on. Define your constructor, copy constructor and destructor. Add some functions to your library, including add_book, delete_book, and more. Run your library!
2.Design and implement a Name_pairs class holding(name,age)pairs where name is a string and age is a double. Represent that as a vector<string>(called name) and a vector<double> (called age) member. Provide an input operation read_names() that reads a series of names. Provide a read_ages() operation that prompts the user for an age for each name. Provide a print() operation that prints out the(name[i],age[i]) pairs (one per line) in the order determined by the name vector. Use sort () to sort the name vector in alphabetical order and reorganizes the age vector to match. Implement all “operations” as member functions. Test the class!
3.Redefine the operator == and != for Name_pairs. Try to replace Name_pair::print() with an operator<< (if you don’t know, just find it on the web).