一.程序主要功能介绍
读者功能
可以进行读者注册、读者登陆、密码修改、显示读者当前信息、查找书籍、查看书库所有信息、上传文件、借阅归还书籍、读者注销(即退出系统)等。
图书信息管理
管理员登录系统(学号010010010 密码 woshiagent,如需修改,请直接修改源代码),可以进行增加、查找、修改、显示、删除图书信息,也可按学号查找读者信息。
图书借还功能
读者使用该功能前必须先注册登录,然后进入书库菜单查询书籍信息,接着在进入借还菜单按屏幕提示输入书籍书名完成借阅归还操作。把每个月当做30天计算,借书时间为一个月,逾期将罚款,可续借。
帮助及说明
有关系统使用的一些说明及帮助教程。
二.程序运行平台
该程序是用VC++6.0制做的,使用Microsoft Visual C++ 6.0运行该程序,具体操作是:打开Microsoft Visual C++ 6.0,菜单栏里点文件→打开工作区→找到“图书管理系统.dsw”这个文件→打开,或者在资源管理器中双击该文件,此时,VC++6.0会自动打开,并载入该系统相关资源,点击Run命令菜单或者或用快捷键Ctrl+F5运行该程序。
三.程序类说明
有关读者信息的类和读者类
struct student //储存读者信息的结构体
{
char name[21]; //读者姓名
char num[10]; //读者学号
char password[21]; //密码
int y_n; //记录借的书的数目
char book1[51]; //借阅书籍1
char book3[51];
char book2[51]; //每个人最多可以借三本
char Book1Num[21]; //书籍1的书名
char Book3Num[21];
char Book2Num[21];
int k1; //记录书籍1已经借出的次数,用
//于判断能否续借。0能,1不能。
int k2;
int k3;
Borrow Btime1; //书籍1借出时间
Return Rtime1; //书籍1应归还时间
Borrow Btime2;
Return Rtime2;
Borrow Btime3;
Return Rtime3;
};
class ReaderLand //读者功能类
{
public:
void reader_register() ; //读者注册
void show_OneReader(); //显示当前读者所有信息
void reader_land(); //读者登录
void search_ReaderNum(); //按学号查找
void load_readerfile(); //上传文件
void change_password() ; //修改密码
void delete_reader() ; //读者注销
void land(); //读者菜单
};
有关图书信息的类和书库类
struct Book //书库信息类
{
char bookname[51]; //书籍名称
char booknum[21]; //书籍编号
char writer[21]; //书籍作者
char publish[51]; //出版商
char date[21]; //出版日期
char content[81]; //书籍内容
int count; //书库现存数量
};
class BookInfo //书库功能类
{
public:
void GoInto_BookInfo(); //书库菜单
void show_all(); //显示所有在架书籍信息
void search(); //查找子菜单
void increase(); //增加新书
void change_content(); //修改书籍信息
void delete_onebook(); //删除书籍信息
void search_BookName(); //按书名查找书籍
void search_ISBN(); //按编号查找书籍
void search_Writer(); //按作者查找书籍
void search_Publisher(); //按出版商查找书籍
void search_PublishDate(); //按出版日期查找书籍
void show_content(); //显示书籍的内容
};
用于借书还书的类
class Borrow //纪录借书的类
{
public:
int month; //借书的月份
int day; //结束的号数
Borrow(int i=0,int j=0){month=0;day=0;}
void Settime(); //记录借书时间
int getBmonth(){return month;}
int getBday(){return day;}
Borrow operator-(const Borrow &right); //重载运算符-,用于计算借书时间
};
class Return //纪录还书的类
{
int month; //应还书的月份
int day; //应还书的号数
public:
Return(int i=0,int j=0){month=i;day=j;}
void Settime(); //记录应还书时间
int getRmonth(){return month;}
int getRday(){return day;}
};
class ConBorrow :public Borrow //纪录续借的类
{
public:
friend void CBorrow( Borrow &temp1, Borrow &temp2, Borrow &temp3); //友元函数,用于判断可否续借书籍
friend void Publish(const Borrow &temp); // 友元函数,用于计算超出借书时间的处罚
};
四.模块分析
² 读者菜单
菜单选项包括:
a.读者注册
b.读者登录
c.密码修改
d.按学号查找
e.显示读者信息
f.页面跳转
g.读者注销
所有函数均封装在类ReaderLand中,在外部定义了一个结构体,将读者信息传到类中,进行记录、修改、存储。我计划将每一个班作为一个文件,记录这个班所有同学的信息。这样可使文件不致过大,从而减少查找时间。
其主要思路是:首先要注册学号,然后输入学号密码后,将姓名放到一个临时数组中,系统会自动比较已记录的字符串是否与临时数组中的字符窜相同。若相同,读者将会登陆成功,查阅自己的信息。
我将这一菜单设为首页,读者或管理员必须经过这一菜单进行登录才能进行其它操作。其他操作完成后,必须返回这一菜单,即首页,注销登录,才能正确退出系统。
² 书库菜单
菜单选项包括:
a. 显示所有库存图书的信息
b. 进入查找菜单
c. 增加图书信息
d. 更改图书信息
e. 删除图书信息
f. 返回上一层
查找子菜单选项包括:
1. 按书名查找书籍
2. 按编号查找书籍
3. 按作者查找书籍
4. 按出版商查找书籍
5. 按出版日期查找书籍
书库信息的建立与读者信息的存储原理相同,创建多个文件记录所有在架图书的信息,每个文件记录同一类型的书籍,需要查找时就直接打开文件查找即可。查找功能,只是将读者输入信息于文件记录信息进行比对,相同者即为所要查找的书籍信息。有关菜单的制作,就是先显示菜单,让用户输入选择,然后用switch来对不同的选择调用类中不同的函数。
² 借书/还书
菜单选项包括:
a. 借书
b. 还书
c. 续借
d. 返回上一层
这个模块的功能主要是连接记录读者信息和书库信息的两个文件,实现书籍信息的正确变动。具体内容包括将读者借阅的书籍及借书时间和数量记录到文件中,同时将书库中已借阅的书籍数目减一,并记录下来,以便其他读者查看。
² 其他
主菜单中剩下的2个选项:4.帮助及说明、 5.返回首页。选项4中都是些文字说明,方便用户有不懂的地方时参考看一下,随着以后功能的不断加多,内容会不断的增多。
选了返回首页后,将回到读者菜单,正常退出是选择读者注销,不然直接按窗口的关闭的话就有可能丢失修改后的数据。
五.程序源代码
**********Readerland.h****************
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<fstream>
#include<string.h>
#include <ctime>
using namespace std;
extern p;
extern char NUM[10];
struct student
{
char name[21];
char num[10];
char password[21];
int y_n; //记录借的书的数目
char book1[51];
char book3[51];
char book2[51]; //每个人最多可以借三本
char Book1Num[21];
char Book3Num[21];
char Book2Num[21];
int k1;
int k2;
int k3;
Borrow Btime1;
Return Rtime1;
Borrow Btime2;
Return Rtime2;
Borrow Btime3;
Return Rtime3;
};
class ReaderLand
{
public:
void reader_register() ; //读者注册
void show_OneReader(); //显示当前读者所有信息
void reader_land(); //读者登录
void search_ReaderNum(); //按学号查找
void load_readerfile(); //上传文件
void change_password() ; //修改密码
void delete_reader() ; //读者注销
void land();
};
**********Readerland.cpp**************
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<fstream>
#include<string.h>
#include <ctime>
using namespace std;
#include"Return.h"
#include"Borrow.h"
#include"ReaderLand.h"
#include"Borrow_Return.h"
#include"ConBorrow.h"
#include"BookInfo.h"
extern p ;
extern char NUM[10];
void Punish( const Borrow &temp)
{
if(temp.month==1&&temp.day==0)
cout<<"暂无/n";
else
{
if(temp.month==0)
cout<<"暂无/n";
if(temp.month==1&&temp.day>0)
cout<<"您已超出借书时间"<<temp.day<<"天,罚款"<<temp.day*0.5<<"元/n";
if(temp.month>1)
cout<<"您已超出借书时间"<<(temp.month*30+temp.day)<<"天,罚款"<<(temp.month*30+temp.day)*0.5<<"元/n";
}
}
void ReaderLand::reader_register() //读者注册
{
cin.ignore();
system("cls");
int i=0;
student person;
cout<<"读者注册/n/n";
cout<<"请输入你的姓名/n";
cin.getline(person.name,21);
cout<<"请输入你的学号/n";
cin.getline(person.num,21);
cout<<"请你设置密码/n";
cin.getline(person.password,21);
cout<<"重新输入密码/n";
char pw[21];
cin.getline(pw,21);
while(strcmp(person.password,pw)!=0)
{
cout<<"两次密码输入不相同,请重新输入/n";cin.getline(pw,21);
}
char b[51]="";
strcpy(person.book1,b);
strcpy(person.book2,b);
strcpy(person.book3,b);
strcpy(person.Book1Num,b);
strcpy(person.Book2Num,b);
strcpy(person.Book3Num,b);
person.y_n=person.k1=person.k2=person.k3=0;
char f[15],fil[5]=".dat";
for(;i<7;i++)
f[i]=person.num[i];
for(int j=0;i<15&&j<5;i++,j++)
f[i]=fil[j];
fstream file;
file.open(f,ios::out|ios::in|ios::binary|ios::app);
if(!file) {
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekp(0l,ios::end);
file.write((char*)&person,sizeof(person));
file.close();
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
void ReaderLand::show_OneReader() //显示当前读者所有信息
{
time_t t;
time(&t);
student person;
struct tm*now = localtime(&t);
int c=1+now->tm_mon;
int d=now->tm_mday;
char f[15],fil[5]=".dat";
int i=0;
for(;i<7;i++)
f[i]=NUM[i];
for(int j=0;i<15&&j<5;i++,j++)
f[i]=fil[j];
fstream file;
file.open(f,ios::out|ios::in|ios::binary);
if(!file){
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&person ,sizeof(person));
if(!file) break;
if(strcmp(NUM,person.num)==0)
{
Borrow time(c,d);
cout<<"姓名: "<<person.name<<endl;
cout<<"学号: "<<person.num<<endl;
cout<<"已借书数目: "<<person.y_n<<endl;
cout<<"1.已借书籍书名: "<<person.book1<<endl;
cout<<"书籍编号: "<<person.Book1Num<<endl;
cout<<"借书日期: "<<person.Btime1.getBmonth()<<"月"<<person.Btime1.getBday()<<"日"<<"还书日期: "<<person.Rtime1.getRmonth()<<"月"<<person.Rtime1.getRday()<<"日/n";
Punish(time-person.Btime1);
cout<<"2.已借书籍书名: "<<person.book2<<endl;
cout<<"书籍编号: "<<person.Book2Num<<endl;
cout<<"借书日期: "<<person.Btime2.getBmonth()<<"月"<<person.Btime2.getBday()<<"日"<<"还书日期: "<<person.Rtime2.getRmonth()<<"月"<<person.Rtime2.getRday()<<"日/n";
Punish(time-person.Btime2);
cout<<"3.已借书籍书名: "<<person.book3<<endl;
cout<<"书籍编号: "<<person.Book3Num<<endl;
cout<<"借书日期: "<<person.Btime3.getBmonth()<<"月"<<person.Btime3.getBday()<<"日"<<"还书日期: "<<person.Rtime3.getRmonth()<<"月"<<person.Rtime3.getRday()<<"日/n";
Punish(time-person.Btime3);
cout<<"*********************************************"<<asctime(now);
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
break;}
}
}
void ReaderLand::reader_land() //读者登录
{
cin.ignore();
system("cls");
cout<<"读者登录/n/n";
student person;
char num[10];
char password[21];
char*agent[2]={"010010010","woshiagent"};
while(1)
{
cout<<"请输入你的学号/n";
cin.getline(num,10);
cout<<"请输入密码/n";
cin.getline(password,21);
if(strcmp(agent[0],num)==0&&strcmp(agent[1],password)==0)
{
p=2;
cout<<"欢迎管理员登录系统/n";
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
break;
}
int i=0;
char f[15],fil[5]=".dat";
for(;i<7;i++)
f[i]=num[i];
for(int j=0;i<15&&j<5;i++,j++)
f[i]=fil[j];
fstream file;
file.open(f,ios::out|ios::in|ios::binary);
if(!file){
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&person ,sizeof(person));
if(!file) break;
if(strcmp(num,person.num)==0)
if(strcmp(password,person.password)==0)
{cout<<"正在登陆/n";p=1; strcpy(NUM,num);system("cls");show_OneReader();break;}
else{ cout<<"密码不正确,请重新输入/n";break;}
}
file.flush();
file.close();
if(p==1) break;
}
}
void ReaderLand::search_ReaderNum() //按学号查找
{
cin.ignore();
system("cls");
if(p==2)
{
char d[21];
cout<<"输入找查找的学号/n";
cin.getline(d,21);
student person;
char f[15],fil[5]=".dat";int i=0;
for(;i<7;i++)
f[i]=d[i];
for(int j=0;i<15&&j<5;i++,j++)
f[i]=fil[j];
fstream file;
file.open(f,ios::out|ios::in|ios::binary);
if(!file){
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&person ,sizeof(person));
if(!file) break;
if(strcmp(d,person.num)==0) {strcpy(NUM,d); break;}
}
show_OneReader();
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
else
{
cout<<"你不是管理员或管理员未登陆/n";
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
}
void ReaderLand::load_readerfile() //上传文件
{cin.ignore();
if(p!=0)
{
char str1[81],str2[81],str[81];
cout<<"请输入你要上传的文件名及其路径/n";
cin.getline(str1,81);
cout<<"请输入上传文件平台/n";
cin.getline(str2,81);
fstream file1(str1,ios::in|ios::binary);
fstream file2(str2,ios::out|ios::binary);
file1>>str;
while(!file1.eof())
{
file2<<str;
file1>>str;
}
file1.close();
file2.close();
}
else
{
cout<<"请你先登陆/n";
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
}
void ReaderLand::change_password() //修改密码
{
cin.ignore();
system("cls");
if(p!=0)
{
int i=0;
student person;
char password[21];
char f[15],fil[5]=".dat";
for(;i<7;i++)
f[i]=NUM[i];
for(int j=0;i<15&&j<5;i++,j++)
f[i]=fil[j];
fstream file;
file.open(f,ios::out|ios::in|ios::binary);
if(!file) {
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&person ,sizeof(person));
if(!file) break;
if(strcmp(NUM,person.num)==0)
{
cout<<"请输入新密码/n";
cin.getline(password,21);
strcpy(person.password,password);
file.clear();
file.seekp(-sizeof(person),ios::cur);
file.write((char*)&person,sizeof(person));
cout<<"密码修改成功/n";
break;
}
}
file.flush();
file.close();
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
else
{
cout<<"请你先登陆/n";
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
}
void ReaderLand::delete_reader() //读者注销
{
p=0;
char num[10]="";
strcpy(NUM,num);
exit(0);
}
void ReaderLand::land() //用户登录的界面函数
{
int choice;
while(true)
{
cout<<"会员登陆: 1.读者注册 2.读者登陆 3.修改密码 4.按学号查找 /n";
cout<<" 5.显示读者信息 6.页面跳转 7.上传文件 8.读者注销/n";
cout<<"请输入您的选择(1-8)/n";
cin>>choice;
switch(choice)
{
case 1:
reader_register();break; //读者注册
case 2:
reader_land();break; //读者登录
case 3:
change_password();break; //修改密码
case 4:
search_ReaderNum();break; //按姓名查找
case 5:
cin.ignore();
show_OneReader();break; //显示所有信息
case 6:
cout<<"页面跳转成功/n";
system("cls");
break;
case 7:
load_readerfile(); //上传文件
break;
case 8:
delete_reader();break; //读者注销
}
if(choice==6) break; //跳出循环
}
}
**********BookInfo.h******************
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<fstream>
#include<string.h>
#include <ctime>
using namespace std;
struct Book
{
char bookname[51];
char booknum[21];
char writer[21];
char publish[51];
char date[21];
char content[81];
int count;
};
class BookInfo
{
public:
void GoInto_BookInfo();
void show_all();
void search();
void increase();
void change_content();
void delete_onebook();
void search_BookName();
void search_ISBN();
void search_Writer();
void search_Publisher();
void search_PublishDate();
void show_content();
};
**********BookInfo.cpp****************
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<fstream>
#include<string.h>
#include <ctime>
using namespace std;
#include"Return.h"
#include"Borrow.h"
#include"ReaderLand.h"
#include"Borrow_Return.h"
#include"ConBorrow.h"
#include"BookInfo.h"
extern p ;
extern char NUM[10];
static int k=0; //判断是否找到该书籍,p=1,表示找到该书籍;p=0,表示没有找到该书籍
void BookInfo::search_ISBN() //按编号查找图书
{
cin.ignore();
system("cls");
Book Info;
char str[81];
cout<<"输入要查找的图书编号/n";
cin.getline(str,81);
cout<<"/n/n";
fstream file("shuku.dat",ios::in|ios::out|ios::binary);
if(!file)
{
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&Info,sizeof(Info));
if(!file) break;
if(strcmp(str,Info.booknum)==0)
{
cout<<"书名: ";
cout<<Info.bookname<<endl;
cout<<"编号: ";
cout<<Info.booknum<<endl;
cout<<"作者: ";
cout<<Info.writer<<endl;
cout<<"数量: ";
cout<<Info.count<<endl;
cout<<"出版商: ";
cout<<Info.publish<<endl;
cout<<"出版日期: ";
cout<<Info.date<<endl;
cout<<"内容: ";
cout<<Info.content<<endl;
k=1;
break;
}
}
if(k==0) cout<<"没有查找到该编号的书籍/n";
k=0;
file.flush();
file.close();
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
void BookInfo::search_BookName() //按书名查找图书
{
cin.ignore();
system("cls");
Book Info;
char str[81];
cout<<"输入要查找的图书书名/n";
cin.getline(str,81);
cout<<"/n/n";
fstream file("shuku.dat",ios::in|ios::out|ios::binary);
if(!file)
{
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&Info,sizeof(Info));
if(!file) break;
if(strcmp(str,Info.bookname)==0)
{
cout<<"书名: ";
cout<<Info.bookname<<endl;
cout<<"编号: ";
cout<<Info.booknum<<endl;
cout<<"作者: ";
cout<<Info.writer<<endl;
cout<<"数量: ";
cout<<Info.count<<endl;
cout<<"出版商: ";
cout<<Info.publish<<endl;
cout<<"出版日期: ";
cout<<Info.date<<endl;
cout<<"内容: ";
cout<<Info.content<<endl;
k=1;
break;
}
}
if(k==0) cout<<"没有查找到该书名的书籍/n";
k=0;
file.flush();
file.close();
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
void BookInfo::search_Writer() //按作者名查找图书
{
cin.ignore();
system("cls");
Book Info;
char str[81];
cout<<"输入要查找的图书的作者/n";
cin.getline(str,81);
cout<<"/n/n";
fstream file("shuku.dat",ios::in|ios::out|ios::binary);
if(!file)
{
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&Info,sizeof(Info));
if(!file) break;
if(strcmp(str,Info.writer)==0)
{
cout<<"书名: ";
cout<<Info.bookname<<endl;
cout<<"编号: ";
cout<<Info.booknum<<endl;
cout<<"作者: ";
cout<<Info.writer<<endl;
cout<<"数量: ";
cout<<Info.count<<endl;
cout<<"出版商: ";
cout<<Info.publish<<endl;
cout<<"出版日期: ";
cout<<Info.date<<endl;
cout<<"内容: ";
cout<<Info.content<<endl;
k=1;
break;
}
}
if(k==0)
cout<<"没有查找到该作者的书籍/n";
k=0;
file.flush();
file.close();
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
void BookInfo::search_Publisher() //按出版商查找图书
{
cin.ignore();
system("cls");
Book Info;
char str[81];
cout<<"输入要查找的图书的出版商/n";
cin.getline(str,81);
cout<<"/n/n";
fstream file("shuku.dat",ios::in|ios::out|ios::binary);
if(!file)
{
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&Info,sizeof(Info));
if(!file) break;
if(strcmp(str,Info.publish)==0)
{
cout<<"书名: ";
cout<<Info.bookname<<endl;
cout<<"编号: ";
cout<<Info.booknum<<endl;
cout<<"作者: ";
cout<<Info.writer<<endl;
cout<<"数量: ";
cout<<Info.count<<endl;
cout<<"出版商: ";
cout<<Info.publish<<endl;
cout<<"出版日期: ";
cout<<Info.date<<endl;
cout<<"内容: ";
cout<<Info.content<<endl;
k=1;
break;
}
}
if(k==0)
cout<<"没有查找到该出版商的书籍/n";
k=0;
file.flush();
file.close();
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
void BookInfo::search_PublishDate() //按出版日期查找图书
{
cin.ignore();
system("cls");
Book Info;
char str[81];
cout<<"输入要查找的图书的出版日期/n";
cin.getline(str,81);
cout<<"/n/n";
fstream file("shuku.dat",ios::in|ios::out|ios::binary|ios::app);
if(!file)
{
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&Info,sizeof(Info));
if(!file) break;
if(strcmp(str,Info.date)==0)
{
cout<<"书名: ";
cout<<Info.bookname<<endl;
cout<<"编号: ";
cout<<Info.booknum<<endl;
cout<<"作者: ";
cout<<Info.writer<<endl;
cout<<"数量: ";
cout<<Info.count<<endl;
cout<<"出版商: ";
cout<<Info.publish<<endl;
cout<<"出版日期: ";
cout<<Info.date<<endl;
cout<<"内容: ";
cout<<Info.content<<endl;
k=1;
break;
}
}
if(k==0)
cout<<"没有查找到该出版日期的书籍/n";
k=0;
file.flush();
file.close();
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
void BookInfo::search() //进入查找菜单
{
system("cls");
int choice;
while(1)
{
cout<<"/n查找菜单: 1.按书名查找图书 2.按编号查找图书 3.按作者名查找图书 /n";
cout<<" 4.按出版商查找图书 5.按出版日期查找图书 6.返回上一层/n";
cout<<"请输入您的选择(1-6)/n";
cin>>choice;
switch(choice)
{
case 1:
search_BookName(); //按书名查找图书
break;
case 2:
search_ISBN(); //按编号查找图书
break;
case 3:
search_Writer(); //按作者名查找图书
break;
case 4:
search_Publisher(); //按出版商查找图书
break;
case 5:
search_PublishDate(); //按出版日期查找图书
break;
case 6:
system("cls");
break;
}
if(choice==6) break;
}
}
/*void BookInfo::show_content() //显示某本书的内容
{
cin.ignore();
system("cls");
Book Info;
char str[81];
cout<<"输入要查找的图书书名/n";
cin.getline(str,81);
fstream file("shuku.dat",ios::in|ios::out|ios::binary);
if(!file)
{
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&Info,sizeof(Info));
if(!file) break;
if(strcmp(str,Info.bookname)==0)
{
cout<<"该书内容简介: ";
cout<<Info.content<<endl;
break;
}
}
file.flush();
file.close();
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}*/
void BookInfo::show_all() //显示所有库存图书的信息
{
cin.ignore();
system("cls");
Book Info;
fstream file("shuku.dat",ios::in|ios::out|ios::binary|ios::app);
if(!file)
{
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&Info,sizeof(Info));
if(!file) break;
cout<<"书名: ";
cout<<Info.bookname<<endl;
cout<<"编号: ";
cout<<Info.booknum<<endl;
cout<<"作者: ";
cout<<Info.writer<<endl;
cout<<"数量: ";
cout<<Info.count<<endl;
cout<<"出版商: ";
cout<<Info.publish<<endl;
cout<<"出版日期: ";
cout<<Info.date<<endl;
cout<<"内容: ";
cout<<Info.content<<endl;
cout<<"/n/n";
}
file.flush();
file.close();
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
void BookInfo::delete_onebook() //删除某本书
{
cin.ignore();
system("cls");
if(p==2)
{
Book Info;Book st={"","","",0,"","",""};
char str[81];
cout<<"输入要删除的图书书名/n";
cin.getline(str,81);
fstream file("shuku.dat",ios::in|ios::out|ios::binary);
if(!file)
{
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&Info,sizeof(Info));
if(!file) break;
if(strcmp(str,Info.bookname)==0)
{
file.seekp(-sizeof(Info),ios::cur);
file.write((char*)&st,sizeof(st));
break;
}
}
cout<<"/n图书信息删除成功/n";
file.flush();
file.close();
}
else {
cout<<"你不是图书管理员,没有权限删除图书/n";
cin.ignore();
}
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
void BookInfo::increase() //增加图书信息
{
cin.ignore();
system("cls");
cout<<"新增书籍/n/n";
if(p==2)
{
Book Info={"","","","","",""};
cout<<"输入新增书籍的书名/n";
cin.getline(Info.bookname,51);
cout<<"输入新增书籍的编号/n";
cin.getline(Info.booknum,21);
cout<<"输入新增书籍的作者/n";
cin.getline(Info.writer,21);
cout<<"请输入新增书籍数目/n";
cin>>Info.count;
cin.ignore();
cout<<"输入新增书籍的出版商/n";
cin.getline(Info.publish,51);
cout<<"输入新增书籍的出版日期/n";
cin.getline(Info.date,21);
cout<<"输入新增书籍的内容介绍/n";
cin.getline(Info.content,81);
fstream file("shuku.dat",ios::in|ios::out|ios::binary|ios::app);
if(!file)
{
cout<<"文件打开失败/n";
exit(0);
}
file.seekp(0*sizeof(Info),ios::end);
file.write((char*)&Info ,sizeof(Info));
file.flush();
file.close();
}
else cout<<"你不是图书管理员,没有权限增加图书类别/n";
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
void BookInfo::change_content() //更改某本书的信息
{
cin.ignore();
system("cls");
if(p==2)
{
Book Info,st={"","","","","",""};
char str[81];
cout<<"/n/n输入要更改信息的图书书名/n";
cin.getline(str,81);
fstream file("shuku.dat",ios::in|ios::out|ios::binary);
if(!file)
{
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&Info,sizeof(Info));
if(!file) break;
if(strcmp(str,Info.bookname)==0)
{
cout<<"书名: ";
cout<<Info.bookname<<endl;
cout<<"编号: ";
cout<<Info.booknum<<endl;
cout<<"作者: ";
cout<<Info.writer<<endl;
cout<<"数量: ";
cout<<Info.count<<endl;
cout<<"出版商: ";
cout<<Info.publish<<endl;
cout<<"出版日期: ";
cout<<Info.date<<endl;
cout<<"内容: ";
cout<<Info.content<<endl;
cout<<"下面输入更改后的书籍信息/n";
cout<<"输入更改后书籍的书名/n";
cin.getline(Info.bookname,51);
cout<<"输入更改后书籍的编号/n";
cin.getline(Info.booknum,21);
cout<<"输入更改后书籍的作者/n";
cin.getline(Info.writer,21);
cout<<"请输入更改后书籍数目/n";
cin>>Info.count;
cin.ignore();
cout<<"输入更改后书籍的出版商/n";
cin.getline(Info.publish,51);
cout<<"输入更改后书籍的出版日期/n";
cin.getline(Info.date,21);
cout<<"输入更改后书籍的内容介绍/n";
cin.getline(Info.content,81);
file.seekp(-sizeof(Info),ios::cur);
file.write((char*)&Info,sizeof(Info));
break;
}
}
cout<<"/n书籍信息修改成功/n";
file.flush();
file.close();
}
else
cout<<"你不是图书管理员,没有权限更改图书信息/n";
cout<<"/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
void BookInfo::GoInto_BookInfo() //进入书库信息菜单
{
int choice;
while(p)
{
cout<<"/n书库信息菜单:1.显示所有库存图书的信息 2.进入查找菜单 3.增加图书信息 /n";
cout<< " 4.更改图书信息 5.删除图书信息 6.返回上一层/n";
cout<<"请输入您的选择(1-6)/n";
cin>>choice;
switch(choice)
{
case 1:
show_all();
break;
case 2:
system("cls");
search();
break;
case 3:
increase();
break;
case 4:
change_content();
break;
case 5:
delete_onebook();
break;
case 6:
system("cls");
break;
}
if(choice==6) break;
}
}
**********Borrow.h********************
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<fstream>
#include<string.h>
#include <ctime>
using namespace std;
class Borrow //纪录借书的类
{
public:
int month;
int day;
Borrow(int i=0,int j=0){month=0;day=0;}
void Settime();
int getBmonth(){return month;}
int getBday(){return day;}
Borrow operator-(const Borrow &right); // ,重载运算符-,用于计算借书时间
};
**********Borrow.cpp******************
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<fstream>
#include<string.h>
#include <ctime>
using namespace std;
#include"Return.h"
#include"Borrow.h"
#include"ReaderLand.h"
#include"Borrow_Return.h"
#include"ConBorrow.h"
#include"BookInfo.h"
extern p ;
extern char NUM[10];
void Borrow::Settime()
{
time_t t;
time(&t);
struct tm*now = localtime(&t);
int c=1+now->tm_mon;
int d=now->tm_mday;
month=c;
day=d;
}
Borrow Borrow::operator-(const Borrow &right)
{
Borrow temp;
temp.month=month-right.month;
temp.day=day-right.day;
return temp;
}
**********ConBorrow.h*****************
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<fstream>
#include<string.h>
#include <ctime>
using namespace std;
class ConBorrow :public Borrow //纪录续借的类
{
public:
friend void CBorrow( Borrow &temp1, Borrow &temp2, Borrow &temp3); // 用于续借书籍
friend void Publish(const Borrow &temp); // 用于计算超出借书时间的处罚
};
**********ConBorrow.cpp***************
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<fstream>
#include<string.h>
#include <ctime>
using namespace std;
#include"Return.h"
#include"Borrow.h"
#include"ReaderLand.h"
#include"Borrow_Return.h"
#include"ConBorrow.h"
#include"BookInfo.h"
extern p ;
extern char NUM[10];
void CBorrow( Borrow &temp1, Borrow &temp2, Borrow &temp3)
{
int i=0;
student person;char ch;
char*book_name[2];
char f[15],fil[5]=".dat";
for(;i<7;i++)
f[i]=NUM[i];
for(int j=0;i<15&&j<5;i++,j++)
f[i]=fil[j];
fstream file;
file.open(f,ios::out|ios::in|ios::binary|ios::app);
if(!file){
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&person ,sizeof(person));
if(!file) break;
if(strcmp(NUM,person.num)==0)
{
book_name[0]=new char(strlen(person.book1)+1);
strcpy(book_name[0],person.book1);
if(temp1.month==1&&temp1.day==0)
{
if(person.k1==0)
{
cout<<book_name[0]<<"已到还书日期,是否续借,请输入(Y/N)/n";
cin.get(ch);
if(ch=='y'||ch=='Y')
{
cout<<"续借成功/n";
temp1.Settime();
person.k1=1;
person.Rtime1.Settime();
}
}
if(person.k1==1)
cout<<"您已续借过一次该书籍,不能再次续借/n";
}
else
cout<<"您尚未达到还书日期或已超出还书日期/n";
cout<<"/n/n";
book_name[1]=new char(strlen(person.book2)+1);
strcpy(book_name[1],person.book2);
if(temp2.month==1&&temp2.day==0)
{
if(person.k2==0)
{
cout<<book_name[1]<<"已到还书日期,是否续借,请输入(Y/N)/n";
cin.get(ch);
if(ch=='y'||ch=='Y')
{
cout<<"续借成功/n";
temp2.Settime();
person.k2=1;
person.Rtime2.Settime();
}
}
if(person.k2==1)
cout<<"您已续借过一次该书籍,不能再次续借/n";
}
else
cout<<"您尚未达到还书日期或已超出还书日期/n";
cout<<"/n/n";
book_name[2]=new char(strlen(person.book3)+1);
strcpy(book_name[2],person.book3);
if(temp3.month==1&&temp3.day==0)
{
if(person.k3==0)
{
cout<<book_name[2]<<"已到还书日期,是否续借,请输入(Y/N)/n";
char ch;
cin.get(ch);
if(ch=='y'||ch=='Y')
{
cout<<"续借成功/n";
temp3.Settime();
person.k3=1;
person.Rtime3.Settime();
}
}
if(person.k3==1)
cout<<"您已续借过一次该书籍,不能再次续借/n";
}
else
cout<<"您尚未达到还书日期或已超出还书日期/n";
cout<<"/n/n";
file.seekp(-sizeof(person),ios::cur);
file.write((char*)&person,sizeof(person));
break;
}
}
file.flush();
file.close();
delete book_name[2];
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
**********Return.h********************
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<fstream>
#include<string.h>
#include <ctime>
using namespace std;
class Return //纪录还书的类
{
int month;
int day;
public:
Return(int i=0,int j=0){month=i;day=j;}
void Settime();
int getRmonth(){return month;}
int getRday(){return day;}
};
**********Return.cpp******************
#include "Return.h"
#include <ctime>
void Return::Settime()
{
time_t t;
time(&t);
struct tm*now = localtime(&t);
int c=1+now->tm_mon;
int d=now->tm_mday;
month=c+1;
day=d;
}
**********Borrow_Return.h*************
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<fstream>
#include<string.h>
#include <ctime>
using namespace std;
class Borrow_Return
{
public:
void B_Rbook();
void Con_Borrow();
void book_return();
void book_borrow();
};
**********Borrow_Return.cpp***********
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<fstream>
#include<string.h>
#include <ctime>
using namespace std;
#include"Return.h"
#include"Borrow.h"
#include"ReaderLand.h"
#include"Borrow_Return.h"
#include"ConBorrow.h"
#include"BookInfo.h"
extern p ;
extern char NUM[10];
void Borrow_Return::book_borrow()
{
static int x=1; //判断该书籍库存量是否为零 :x=1,库存量>0; x=0,库存量=0
char str[51],st[51];
char ch;
Book Info;
student person;
cin.ignore();
system("cls");
cout<<"你要借阅的书籍书名/n";
cin.getline(str,51);
fstream file1("shuku.dat",ios::in|ios::out|ios::binary);
if(!file1)
{
cout<<"文件打开失败/n";
exit(0);
}
file1.clear();
file1.seekg(0l,ios::beg);
while(!file1.eof())
{
file1.read((char*)&Info,sizeof(Info));
if(!file1) break;
if(strcmp(str,Info.bookname)==0)
{
if(Info.count==0){x=0;cout<<"该书籍现库存量为零,无法借阅/n";break;}
Info.count--;
strcpy(st,Info.booknum);
file1.seekp(-sizeof(Info),ios::cur);
file1.write((char*)&Info,sizeof(Info));
break;
}
}
file1.flush();
file1.close();
char f[15],fil[5]=".dat";
int i=0;
for(;i<7;i++)
f[i]=NUM[i];
for(int j=0;i<15&&j<5;i++,j++)
f[i]=fil[j];
fstream file2;
file2.open(f,ios::out|ios::in|ios::binary);
if(!file2) {
cout<<"文件打开失败/n";
exit(0);
}
file2.clear();
file2.seekg(0l,ios::beg);
while(!file2.eof())
{
file2.read((char*)&person ,sizeof(person));
if(!file2) break;
if(x==0) break;
if(strcmp(NUM,person.num)==0)
{
strcpy(person.book1,str);
strcpy(person.Book1Num,st);
person.y_n++;
person.Btime1.Settime();
person.Rtime1.Settime();
file2.seekp(-sizeof(person),ios::cur);
file2.write((char*)&person,sizeof(person));
break;
}
}
file2.flush();
file2.close();
if(x==1)
cout<<"/n"<<str<<"书籍借阅成功/n/n";
x=1;
cout<<"是否继续借阅书籍?(Y/N)/n";
cout<<"选择: ";
cin.get(ch);
cin.ignore();
cout<<endl;
if(ch=='y'||ch=='Y')
{ cout<<"你要借阅的书籍书名/n";
cin.getline(str,51);
fstream file3("shuku.dat",ios::in|ios::out|ios::binary);
if(!file3)
{
cout<<"文件打开失败/n";
exit(0);
}
file3.clear();
file3.seekg(0l,ios::beg);
while(!file3.eof())
{
file3.read((char*)&Info,sizeof(Info));
if(!file3) break;
if(strcmp(str,Info.bookname)==0)
{
if(Info.count==0){x=0;cout<<"该书籍现库存量为零,无法借阅/n";break;}
Info.count--;
strcpy(st,Info.booknum);
file3.seekp(-sizeof(Info),ios::cur);
file3.write((char*)&Info,sizeof(Info));
break;
}
}
file3.flush();
file3.close();
char f[15],fil[5]=".dat";int i=0;
for(;i<7;i++)
f[i]=NUM[i];
for(int j=0;i<15&&j<5;i++,j++)
f[i]=fil[j];
fstream file4;
file4.open(f,ios::out|ios::in|ios::binary);
if(!file4) {
cout<<"文件打开失败/n";
exit(0);
}
file4.clear();
file4.seekg(0l,ios::beg);
while(!file4.eof())
{
file4.read((char*)&person ,sizeof(person));
if(!file4) break;
if(x==0) break;
if(strcmp(NUM,person.num)==0)
{
if(Info.count==0){x=0;cout<<"该书籍先库存量为零,无法借阅/n";break;}
strcpy(person.book2,str);
strcpy(person.Book2Num,st);
person.y_n++;
person.Btime2.Settime();
person.Rtime2.Settime();
file4.seekp(-sizeof(person),ios::cur);
file4.write((char*)&person,sizeof(person));
break;
}
}
file4.flush();
file4.close();
if(x==1)
cout<<"/n"<<str<<"书籍借阅成功/n/n";
x=1;
cout<<"是否继续借阅书籍?(Y/N)/n";
cout<<"选择: ";
cin.get(ch);
cin.ignore();
cout<<endl;
if(ch=='y'||ch=='Y')
{ cout<<"你要借阅的书籍书名/n";
cin.getline(str,51);
fstream file5("shuku.dat",ios::in|ios::out|ios::binary);
if(!file5)
{
cout<<"文件打开失败/n";
exit(0);
}
file5.clear();
file5.seekg(0l,ios::beg);
while(!file5.eof())
{
file5.read((char*)&Info,sizeof(Info));
if(!file5) break;
if(strcmp(str,Info.bookname)==0)
{
if(Info.count==0){x=0;cout<<"该书籍现库存量为零,无法借阅/n";break;}
Info.count--;
strcpy(st,Info.booknum);
file5.seekp(-sizeof(Info),ios::cur);
file5.write((char*)&Info,sizeof(Info));
break;
}
}
file5.flush();
file5.close();
char f[15],fil[5]=".dat";int i=0;
for(;i<7;i++)
f[i]=NUM[i];
for(int j=0;i<15&&j<5;i++,j++)
f[i]=fil[j];
fstream file6;
file6.open(f,ios::out|ios::in|ios::binary);
if(!file6){
cout<<"文件打开失败/n";
exit(0);
}
file6.clear();
file6.seekg(0l,ios::beg);
while(!file6.eof())
{
file6.read((char*)&person ,sizeof(person));
if(!file6) break;
if(x==0) break;
if(strcmp(NUM,person.num)==0)
{
strcpy(person.book3,str);
strcpy(person.Book3Num,st);
person.y_n++;
person.Btime3.Settime();
person.Rtime3.Settime();
file6.seekp(-sizeof(person),ios::cur);
file6.write((char*)&person,sizeof(person));
break;
}
}
file6.flush();
file6.close();
if(x==1)
cout<<"/n"<<str<<"书籍借阅成功/n/n";
x=1;
}
}
cin.ignore();
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
void Borrow_Return::book_return()
{
char str[51],st[51]="";
cin.ignore();
system("cls");
Book Info;
student person;
Borrow time1;
Return time2;
cout<<"你要归还的书籍书名/n";
cin.getline(str,51);
fstream file1("shuku.dat",ios::in|ios::out|ios::binary);
if(!file1)
{
cout<<"文件打开失败/n";
exit(0);
}
file1.clear();
file1.seekg(0l,ios::beg);
while(!file1.eof())
{
file1.read((char*)&Info,sizeof(Info));
if(!file1) break;
if(strcmp(str,Info.bookname)==0)
{
Info.count++;
file1.seekp(-sizeof(Info),ios::cur);
file1.write((char*)&Info,sizeof(Info));
break;
}
}
file1.flush();
file1.close();
char f[15],fil[5]=".dat";int i=0;
for(;i<7;i++)
f[i]=NUM[i];
for(int j=0;i<15&&j<5;i++,j++)
f[i]=fil[j];
fstream file2;
file2.open(f,ios::out|ios::in|ios::binary);
if(!file2) {
cout<<"文件打开失败/n";
exit(0);
}
file2.clear();
file2.seekg(0l,ios::beg);
while(!file2.eof())
{
file2.read((char*)&person ,sizeof(person));
if(!file2) break;
if(strcmp(NUM,person.num)==0)
{
if(strcmp(person.book1,str)==0)
{strcpy(person.book1,st);person.Btime1=time1;person.Rtime1=time2;person.k1=0;strcpy(person.Book1Num,st);person.y_n--;}
if(strcmp(person.book2,str)==0)
{strcpy(person.book2,st);person.Btime2=time1;person.Rtime2=time2;person.k2=0;strcpy(person.Book2Num,st);person.y_n--;}
if(strcmp(person.book3,str)==0)
{strcpy(person.book3,st);person.Btime3=time1;person.Rtime3=time2;person.k3=0;strcpy(person.Book3Num,st);person.y_n--;}//tuyijbklscfjdlkfjsklfjdsklfjdsklfjsdkalfdsjfhdsjkfhsdkj
file2.seekp(-sizeof(person),ios::cur);
file2.write((char*)&person,sizeof(person));
break;
}
}
file2.flush();
file2.close();
cout<<"/n";
cout<<"书籍"<<str<<"归还成功/n";
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
void Borrow_Return::Con_Borrow()
{
cin.ignore();
system("cls");
int i=0;
int a,b,c,d,e,s;
student person;
char f[15],fil[5]=".dat";
for(;i<7;i++)
f[i]=NUM[i];
for(int j=0;i<15&&j<5;i++,j++)
f[i]=fil[j];
fstream file;
file.open(f,ios::out|ios::in|ios::binary);
if(!file) {
cout<<"文件打开失败/n";
exit(0);
}
file.clear();
file.seekg(0l,ios::beg);
while(!file.eof())
{
file.read((char*)&person ,sizeof(person));
if(!file) break;
if(strcmp(NUM,person.num)==0)
{
a=person.Btime1.month;
b=person.Btime1.day;
c=person.Btime2.month;
d=person.Btime2.day;
e=person.Btime3.month;
s=person.Btime3.day;
break;
}
}
file.flush();
file.close();
Borrow A,B1(a,b),B2(c,d),B3(e,s);
Borrow A1=B1-A,A2=B2-A,A3=B2-A;
CBorrow(A1,A2,A3);
}
void Borrow_Return::B_Rbook() //借书还书菜单
{
int choice;
while(p)
{
cout<<"/n借阅菜单: 1.借书 2.还书 3.续借 4.返回上一层/n";
cout<<"请输入你的选择(1-4)/n";
cin>>choice;
switch(choice)
{
case 1:
book_borrow();
break;
case 2:
book_return();
break;
case 3:
Con_Borrow();
break;
case 4:
system("cls");
break;
}
if(choice==4) break;
}
}
**********main.cpp********************
#include<iostream>
#include<stdlib.h>
#include<iomanip>
#include<fstream>
#include<string.h>
#include <ctime>
using namespace std;
int p=0; //判断读者是否登陆,p==1,登陆;p==0,未登陆;p==2,管理员登陆;
char NUM[10]=""; //用于记录登陆读者的学号
#include"Return.h"
#include"Borrow.h"
#include"ReaderLand.h"
#include"Borrow_Return.h"
#include"ConBorrow.h"
#include"BookInfo.h"
void Help_Instruction()
{
cout<<"/n";
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
}
int main()
{
cout<<"/n *******************南京航空航天大学****************************/n/n";
cout<<"/n *******************图书馆管理系统******************************/n/n";
cout<<"/n ************************欢迎您*********************************/n/n";
cout<<"/n ****************************************************董文帅 编 /n";
cout<<"/n ****************************************************041040327 /n";
cout<<"/n ****************************************************10年5月14日/n";
cout<<"";
cout<<"/n/n/n/npress “enter”to continue...";
cin.ignore();
system("cls");
ReaderLand reader;
reader.land();
int choice;
while(p)
{
cout<<"/n菜单选项: 1.书库信息 2.借书或还书 3.帮助及说明 4.返回首页/n";
cout<<"请输入您的选择(1-4)/n";
cin>>choice;
switch(choice)
{
case 1:
system("cls");
BookInfo A; //进入书库信息菜单
A.GoInto_BookInfo();
break;
case 2:
system("cls");
Borrow_Return B; //借书还书菜单
B.B_Rbook();break;
case 3:
system("cls");
Help_Instruction();break;
case 4:
system("cls");
reader.land();
}
}
return 0;
}