求这三个题的完整代码

weixin_44816849 2019-03-22 12:24:57
C++小白实在写不出来
...全文
43 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
pengw82 2019-03-28
  • 打赏
  • 举报
回复
哪个学校的?
weixin_44816849 2019-03-22
  • 打赏
  • 举报
回复
引用 楼主 weixin_44816849的回复:
C++小白实在写不出来
文字版 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).

65,210

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧