欢迎来到天天文库
浏览记录
ID:15840129
大小:50.00 KB
页数:20页
时间:2018-08-06
《图书信息管理系统83513》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、图书信息管理系统83513#include#include#include#includestructbookData{intbooknumber;charbookname[30];intstore;};structPerson{charname[20];charstudynumber[10];intcount;bookDataRbook[2];//bookDataRbook;};classHistory{public:History(fstrea
2、m&a){readerbook=a;}voidwritehistory();voidreadhistory(fstream&);private:fstreamreaderbook;};classLiberian;voidFind(fstream&);voidCreateTxt(fstream&);classReader{friendLiberian;public:Reader(fstream&);voidprint();voidhandlebook(fstream&);voidchange();boolfindreader();vo
3、idAddreader();voiddeletereader();private:fstreamfile;Personperson;};classLiberian{public:Liberian(char*,char*);voidchangeReader(Reader&);voidselfprint();voidAppend(fstream&);private:charworkname[20];charworknumber[20];};intmain(){fstreambookRecord("book.dat",ios::in
4、io
5、s::out);if(!bookRecord){cerr<<"Can'topen,tryagain!"<6、ios::out);if(!readerRecord){cerr<<"Can'topen,tryagain!"<7、员Historyrec(readerRecord);//声明显示历史记录类while(1){cout<<"请输入您的选择:"<<"1--图书管理员"<<"2--读者系统"<<"0--结束程序";cin>>choice;switch(choice){case1:{cout<<"Hello,图书管理员:";liberian.selfprint();cout<>key;swi8、tch(key){case1:liberian.Append(bookRecord);break;case2:liberian.changeReader(reader);break;case3:rec.readhistory(readerRecord);case0:break;}}break;case2:{cout<<"学生读者";intiflag=1;//reader.findreader();cout<<"1--借书与还书信息"<<"2--修改个人信息"<<"0--返回";cin>>key;switch(key)9、{case1:reader.handlebook(bookRecord);break;case2:reader.change();break;case0:break;}}break;default:return0;}}return0;}//增加书籍voidLiberian::Append(fstream&storef){bookDatabook;intchoice;intkey;intnum;storef.seekp(0,ios::end);intposEnd=storef.tellp();cout<<"*************书10、籍入库***************"<
6、ios::out);if(!readerRecord){cerr<<"Can'topen,tryagain!"<7、员Historyrec(readerRecord);//声明显示历史记录类while(1){cout<<"请输入您的选择:"<<"1--图书管理员"<<"2--读者系统"<<"0--结束程序";cin>>choice;switch(choice){case1:{cout<<"Hello,图书管理员:";liberian.selfprint();cout<>key;swi8、tch(key){case1:liberian.Append(bookRecord);break;case2:liberian.changeReader(reader);break;case3:rec.readhistory(readerRecord);case0:break;}}break;case2:{cout<<"学生读者";intiflag=1;//reader.findreader();cout<<"1--借书与还书信息"<<"2--修改个人信息"<<"0--返回";cin>>key;switch(key)9、{case1:reader.handlebook(bookRecord);break;case2:reader.change();break;case0:break;}}break;default:return0;}}return0;}//增加书籍voidLiberian::Append(fstream&storef){bookDatabook;intchoice;intkey;intnum;storef.seekp(0,ios::end);intposEnd=storef.tellp();cout<<"*************书10、籍入库***************"<
7、员Historyrec(readerRecord);//声明显示历史记录类while(1){cout<<"请输入您的选择:"<<"1--图书管理员"<<"2--读者系统"<<"0--结束程序";cin>>choice;switch(choice){case1:{cout<<"Hello,图书管理员:";liberian.selfprint();cout<>key;swi
8、tch(key){case1:liberian.Append(bookRecord);break;case2:liberian.changeReader(reader);break;case3:rec.readhistory(readerRecord);case0:break;}}break;case2:{cout<<"学生读者";intiflag=1;//reader.findreader();cout<<"1--借书与还书信息"<<"2--修改个人信息"<<"0--返回";cin>>key;switch(key)
9、{case1:reader.handlebook(bookRecord);break;case2:reader.change();break;case0:break;}}break;default:return0;}}return0;}//增加书籍voidLiberian::Append(fstream&storef){bookDatabook;intchoice;intkey;intnum;storef.seekp(0,ios::end);intposEnd=storef.tellp();cout<<"*************书
10、籍入库***************"<
此文档下载收益归作者所有