https://download.csdn.net/download/weixin_45525272/12522372
/*********************************************************************
*Target:高校图书馆管理系统的实现
*Author:杨永利
*Date:2021.06.27
*1、2021.06.27 micro·杨 建立项目 无修改
*********************************************************************/
#include"pch.h"
#include"Book.h"
#include"Reader.h"
#include"Register.h"
int main()
{
cout << "初始账号,密码:123 123" << endl;
cout << endl;
MainDesk yourdesk;
if (yourdesk.Register())
{
cout << "感谢使用本产品,再见!";
}
return 0;
}
#pragma once
#include "pch.h"
#include <iostream>
#include <string.h>
#include <fstream>
#include <string>
#include <iomanip>
using namespace std;
const int MaxBook = 100;//最大的图书量
//const int MaxReader = 100;//最大的读者数
//const int MaxBorrow = 5;//每次最多可以借书的数量
//图书类
class Book
{
public:
//获取书名
char *GetBookName()
{
return BookName;
}
//获取作者
char *GetAuthor()
{
return Author;
}
//获取书籍ID
int GetBookID()
{
return BookID;
}
//获取书的类别
char *GetClassify()
{
return Classify;
}
//获取出版社
char *GetPress()
{
return Press;
}
//获取出版社时间
int GetPublicationTime()
{
return PublicationTime;
}
//获取价格
double GetBookPrice()
{
return BookPrice;
}
//获取标签
int GetTag()
{
return Tag;
}
//设置编号
void SetBookID(int bookID)
{
BookID = bookID;
}
//设置书名
void SetBookName(char BookName[20])
{
strcpy(BookName, BookName);
}
//设置作者
void SetAuthor(char author[20])
{
strcpy(Author, author);
}
//设置书籍类别
void SetClassify(char classify[20])
{
strcpy(Classify, classify);
}
//设置出版社
void SetPress(char press[20])
{
strcpy(Press, press);
}
//设置出版时间
void SetPublicationTime(int publicationtime)
{
PublicationTime = publicationtime;
}
//设置价格
void SetBookPrice(double bookprice)
{
BookPrice = bookprice;
}
//设置是否在架
void SetOnshelf(double onshelf)
{
Onshelf = onshelf;
}
//删除书籍
void Deletebook()
{
cout << "你确定删除书籍吗? Y/N" << endl;
char i;
cin >> i;
if (i == 'y' || i == 'Y')
{
Tag = 1;
}
}
//增加书籍
void AddBook(int bookID, char* bookname, char*auther,
char*classify, char * press, int publicationtime,
double bookprice, int onshelf)
{
Tag = 0;
BookID = bookID;
strcpy(BookName, bookname);
strcpy(Author, auther);
strcpy(Classify, classify);
strcpy(Press, press);
PublicationTime = publicationtime;
BookPrice = bookprice;
Onshelf = onshelf;
}
//借书操作
int BorrowBook()
{
if (Onshelf > 0)
{
Onshelf--;//库存-1
return 1;
}
return 0;
}
//还书操作
void ReturnBook()
{
Onshelf++;
}
//预览书籍信息(打印书籍信息,每本 本本书)
void DisBook()
{
cout << BookID << setw(10) << BookName << setw(10) << Author;
cout << setw(10) << Classify <<setw(10)<< Press <<setw(10) << PublicationTime;
cout << setw(10) << BookPrice << setw(10) << Onshelf << endl;
}
private:
int Tag;//标签 1已删除 0未删除
int BookID;//编号
char BookName[20];//书名
char Author[20];//作者
char Classify[20];//分类
char Press[20];//出版社
int PublicationTime;//出版时间
double BookPrice;//价格
int Onshelf;//是否在架 .在架>0 .已借出=0
};
//图书库类:实现图书的增删改查等维护功能。
class BookDateBase
{
public:
//构造函数用于读取上一次书籍读取情况
BookDateBase()
{
top = -1;
Book b;
fstream file("book.txt", ios::in);
while (true)
{
file.read((char*)&b, sizeof(b));
if (!file)
{
break;//未读到数据 跳出循环
}
top++;
book[top] = b;
}
file.close();
}
//删除所有书籍
void ClearDate()
{
cout << "确定要删除全部数据吗? Y/N" << endl;
char i;
cin >> i;
if (i == 'y' || i == 'Y')
{
top = -1;
}
}
//增加书籍
int AddBook(int bookID, char* bookname, char*author,
char*classify, char * press, int publicationtime,
double bookprice, int onshelf)
{
Book*p = Query1(bookID);//书籍不存在,可以进货
if (p == 0)
{
top++;
book[top].AddBook(bookID, bookname, author, classify,
press, publicationtime, bookprice, onshelf);
return 1;
}
return 0;
}
//按照编号查找书籍
Book *Query1(int bookid)
{
for (int i = 0; i < top; i++)
{
if (book[i].GetBookID() == bookid && book[i].GetTag() == 0)
{
return &book[i];
}
}
return 0;
}
//按照书名查找书籍
Book *Query2(char bookname[])
{
Book *e;
int r = 0;
for (int i = 0; i < top; i++)
{
if (strcmp(book[i].GetBookName(), bookname) == 0 && book[i].GetTag() == 0)
{
//栏目标签
cout << "编号" << setw(10) << "书名" << setw(10) << "作者" << setw(10);
cout << "分类" << setw(10) << "出版社" << setw(10) << "出版时间" << setw(10);
cout << "价格" << setw(10) << "存量" << endl;
e = &book[i];
e->DisBook();
r++;
}
}
if (r == 0)
{
cout << "查无此书" << endl;
}
return 0;
}
//按照作者查找书籍
Book *Query3(char author[])
{
Book *e;
int r = 0;
for (int i = 0; i < top; i++)
{
if (strcmp(book[i].GetBookName(), author) == 0 && book[i].GetTag() == 0)
{
//栏目标签
cout << "编号" << setw(10) << "书名" << setw(10) << "作者" << setw(10);
cout << "分类" << setw(10) << "出版社" << setw(10) << "出版时间" << setw(10);
cout << "价格" << setw(10) << "存量" << endl;
e = &book[i];
e->DisBook();
r++;
}
}
if (r == 0)
{
cout << "查无此书!" << endl;
}
return 0;
}
//按照出版社查找书籍
Book *Query4(char press[])
{
Book *e;
int r = 0;
for (int i = 0; i < top; i++)
{
if (strcmp(book[i].GetBookName(), press) == 0 && book[i].GetTag() == 0)
{
//栏目标签
cout << "编号" << setw(10) << "书名" << setw(10) << "作者" << setw(10);
cout << "分类" << setw(10) << "出版社" << setw(10) << "出版时间" << setw(10);
cout << "价格" << setw(10) << "存量" << endl;
e = &book[i];
e->DisBook();
r++;
}
}
if (r == 0)
{
cout << "查无此书!" << endl;
}
return 0;
}
//显示图书管的信息
void DispDate()
{
for (int i = 0; i <= top; i++)
{
//显示未删除的书籍信息
if (book[i].GetTag() == 0)
{
book[i].DisBook();
}
}
}
//图书库信息
void bookdate();
//将当前的书籍借还情况写入文件
~BookDateBase()
{
fstream file("book.txt", ios::out);
for (int i = 0; i <= top; i++)
{
if (book[i].GetTag() == 0)
{
file.write((char*)&book[i], sizeof(book[i]));
}
}
file.close();
}
private:
int top;//图书信息存量
Book book[MaxBook];//图书的最大存量
};
//***BookDateBase类里的图书库信息
void BookDateBase::bookdate()
{
Book *b;//书籍的指针
int bookID;//编号
char bookname[20];//书名
char author[20];//作者
char classify[20];//分类
char press[20];//出版社
int publicationtime;//出版时间
double bookprice;//价格
int onshelf;//是否在架 .在架>0 .已借出=0
char choice1 = 1 ;//输入指令
char choice2 = 0;//输入指令
char choice3 = 0;//输入指令
char choice4 = 0;//输入指令
while (choice1 != '0')
{
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "**** 图书管理系统 ****" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "** 1.增加图书 2.更改图书 3.删除图书 **" << endl;
cout << "** 4.查询图书 5.显示图书 6.清空图书 **" << endl;
cout << "** **" << endl;
cout << "** 0.返回上一级目录 **" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cout << "请选择:0-6" << endl;
cin >> choice1;
switch (choice1)
{
case'1':
{
cout << "请输入增加图书的编号:";
cin >> bookID;
b = Query1(bookID);
if (b != 0)
{
cout << "该书籍已存在无法重复添加!" << endl;
break;
}
cout << "请输入增加书籍的书名:";
cin >> bookname;
cout << "请输入增加书籍的作者:";
cin >> author;
cout << "请输入增加书籍的分类:";
cin >> classify;
cout << "请输入增加书籍的出版社:";
cin >> press;
cout << "请输入增加书籍的出版时间:";
cin >> publicationtime;
cout << "请输入增加书籍的价格:";
cin >> bookprice;
cout << "请输入增加书籍的数量:";
cin >> onshelf;
int t;
t = AddBook(bookID, bookname, author, classify,
press, publicationtime, bookprice, onshelf);
if (t == 1)
{
cout << "图书添加成功!" << endl;
}
else if (t == 0)
{
cout << "图书添加失败!" << endl;
}
break;
}
case'2':
{
cout << "请输入图书编号:";
cin >> bookID;
b = Query1(bookID);
if (b == 0)
{
cout << "该书籍不存在,无法更改!" << endl;
break;
}
cout << "编号" << setw(10) << "书名" << setw(10) << "作者" << setw(10);
cout << "分类" << setw(10) << "出版社" << setw(10) << "出版时间" << setw(10);
cout << "价格" << setw(10) << "存量" << endl;
b->DisBook();
cout << "是否修改? Y/N";
cin >> choice2;
if (choice2 == 'y' || choice2 == 'Y')
{
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "**** 图书管理系统:修改操作 ****" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "** 1.修改书名 2.修改作者 3.修改分类 **" << endl;
cout << "** 4.修改出版社 5.修改出版时间 6.修改价格 **" << endl;
cout << "** 7.修改存量 **" << endl;
cout << "** 0.返回上一级目录 **" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cout << "请选择:0-7" << endl;
cin >> choice3;
switch (choice3)
{
case'1':
cout << "请输入新的书名:";
cin >> bookname;
b->SetBookName(bookname);
break;
case'2':
cout << "请输入新的作者:";
cin >> author;
b->SetAuthor(author);
break;
case'3':
cout << "请输入新的分类:";
cin >> classify;
b->SetClassify(classify);
break;
case'4':
cout << "请输入新的出版社:";
cin >> press;
b->SetPress(press);
break;
case'5':
cout << "请输入新的出版时间:";
cin >> publicationtime;
b->SetPublicationTime(publicationtime);
break;
case'6':
cout << "请输入新的价格:";
cin >> bookprice;
b->SetBookPrice(bookprice);
break;
case'7':
cout << "请输入新的存量:";
cin >> onshelf;
b->SetOnshelf(onshelf);
break;
case'0':
break;
}
}
cout << "图书信息修改成功!" << endl;
break;
}
case'3':
{
cout << "请输入图书的编号:";
cin >> bookID;
b = Query1(bookID);
if (b == 0)
{
cout << "该书籍不存在,无法更改!" << endl;
break;
}
b->Deletebook();
cout << "删除成功";
break;
}
case'4':
{
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "**** 图书管理系统 (查询图书) ****" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "** 1.按照编号查找 2.按照书名查找 3.按照作者查找 **" << endl;
cout << "** 4.按照出版社查找 **" << endl;
cout << "** **" << endl;
cout << "** 0.返回上一级目录 **" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cin >> choice4;
switch (choice4)
{
case'1':
cout << "请输入图书编号:";
cin >> bookID;
b = Query1(bookID);
if (b == 0)
{
cout << "该书籍不存在!" << endl;
break;
}
cout << "编号" << setw(10) << "书名" << setw(10) << "作者" << setw(10);
cout << "分类" << setw(10) << "出版社" << setw(10) << "出版时间" << setw(10);
cout << "价格" << setw(10) << "存量" << endl;
b->DisBook();
break;
case'2':
cout << "请输入图书书名:";
cin >> bookname;
b = Query2(bookname);
break;
case'3':
cout << "请输入图书作者:";
cin >> author;
b = Query3(author);
break;
case'4':
cout << "请输入图书出版社:";
cin >> press;
b = Query4(press);
break;
case'0':
break;
}
}
case'5':
cout << "编号" << setw(10) << "书名" << setw(10) << "作者" << setw(10);
cout << "分类" << setw(10) << "出版社" << setw(10) << "出版时间" << setw(10);
cout << "价格" << setw(10) << "存量" << endl;
DispDate();
break;
case'6':
ClearDate();
break;
case'0':
break;
}
}
}
#pragma once
#include"Book.h"
#include "pch.h"
#include <iostream>
#include <string.h>
#include <fstream>
#include <string>
#include <iomanip>
using namespace std;
//const int MaxBook = 100;//最大的图书量
const int MaxReader = 100;//最大的读者数
const int MaxBorrow = 5;//每次最多可以借书的数量
//读者类:描述读者信息
class Reader
{
public:
char* GetName()
{
return ReaderName;
}
int GetTag()
{
return Tag;
}
int GetReaderID()
{
return ReaderID;
}
void SetReaderName(char readername[20])
{
strcpy(ReaderName, readername);
}
void DeleteReader()
{
cout << "你确定删除读者吗? Y/N" << endl;
char i;
cin >> i;
if (i == 'y' || i == 'Y')
{
Tag = 1;
}
}
//增加读者
void AddReader(int readerID, char* readername)
{
Tag = 0;
ReaderID = readerID;
strcpy(ReaderName, readername);
for (int i = 0; i < MaxBorrow; i++)//新读者借书都是0,首先给新读者对象成员赋值
{
Borrowbook[i] = 0;
}
}
void BorrowBook(int bookID)
{
for (int i = 0; i < MaxBorrow; i++)
{
if (Borrowbook[i] == 0)
{
Borrowbook[i] == bookID;
return ;
}
}
}
//还书操作
int ReturnBook(int bookID)
{
for (int i = 0; i < MaxBorrow; i++)
{
if (Borrowbook[i] == bookID)
{
Borrowbook[i] = 0;
cout << "还书成功!" << endl;
return 1;
}
}
cout << "你未借过此书,还书失败!" << endl;
return 0;
}
//显示读者
void DisReader()
{
int number = 0;
int bz = 0;
cout << setw(5) << ReaderID << setw(20) << ReaderName << setw(5);
for (int i = 0; i < MaxBorrow; i++)
{
if (Borrowbook[i] != 0)
{
if (bz == 0)
{
number = 1;
cout << "[" << Borrowbook[i] << "]" << endl;
bz++;
}
else
{
cout << setw(5) << ReaderID << setw(20) << ReaderName << setw(5) << "[" << Borrowbook[i] << "]" << endl;
}
}
}
if (number == 0)
{
cout << "未借书!" << endl;
}
}
private:
int Tag;//标签1已删除 0未删除
int ReaderID;
char ReaderName[20];
int Borrowbook[MaxBorrow];
};
//读者库类:描述了对读者的操作
class ReaderDatebase
{
public:
//构造函数用于读取上一次读者读取情况
ReaderDatebase()
{
Reader s;
top = -1;
Book b;
fstream file("reader.txt", ios::in);
while (true)
{
file.read((char*)&s, sizeof(s));
if (!file)
{
break;//未读到数据 跳出循环
}
top++;
reader[top] = s;
}
file.close();
}
//删除读者信息
void ClearReaderDate()
{
cout << "确定要删除吗? Y/N" << endl;
char i;
cin >> i;
if (i == 'y' || i == 'Y')
{
top = -1;
}
}
//增加读者
int AddReader(int readerID, char*readername)
{
//先找这个人
Reader *p = QueryID(readerID);
if (p !=0)
{
top++;
reader[top].AddReader(readerID, readername);//读者类里面的成员在读者库类里面实现调用
return 1;
}
else
{
cout << "该编号已存在!" << endl;
return 0;
}
}
//按照ID查找读者
Reader*QueryID(int readerID)
{
for (int i = 0; i <= top; i++)
{
if (reader[i].GetReaderID() == readerID && reader[i].GetTag() == 0)
{
return &reader[i];
}
return 0;
}
}
//按照名字查找读者
Reader*QueryReaderName(char readername[20])
{
for (int i = 0; i <= top; i++)
{
if (strcpy(reader[i].GetName(), readername) && reader[i].GetTag() == 0)
{
return &reader[i];
}
return 0;
}
}
//显示所有读者的信息
void DisReader()
{
for (int i = 0; i <= top; i++)
{
if (reader[i].GetTag() == 0)//==0是未删除 前面标签已经定义 =0打印
{
reader[i].DisReader();//每次输出一个读者的信息
}
}
}
//读者库信息
void ReaderDate();
//析构函数 将当前的所有的读者信息写入文件
~ReaderDatebase()
{
fstream file("reader.txt", ios::out);
for (int i = 0; i <= top; i++)
{
if (reader[i].GetTag() == 0)
{
file.write((char*)&reader[i], sizeof(reader[i]));
}
}
file.close();
}
private:
int top;
Reader reader[MaxReader];
};
//***ReaderDatebase类里的读者库信息
void ReaderDatebase::ReaderDate()
{
Reader *r;
int readerID;
char readername[20];
char choice1 = 0;
char choice2 = 0;
while (choice1 != '0')
{
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "**** 图书管理系统 :读者菜单 ****" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "** 1.增加读者 2.更改读者 3.删除读者 **" << endl;
cout << "** 4.查询读者 5.显示读者 6.清空读者 **" << endl;
cout << "** **" << endl;
cout << "** 0.返回上一级目录 **" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cout << "请选择:0-6" << endl;
cin >> choice1;
switch (choice1)
{
case'1':
{
cout << "请输入读者编号:";
cin >> readerID;
cout << "请输入读者姓名:";
cin >> readername;
AddReader(readerID, readername);
cout << "添加读者成功!" << endl;
break;
}
case '2':
{
cout << "请输入读者编号:";
cin >> readerID;
//判断有没有这个人
r = QueryID(readerID);
if (r == 0)
{
cout << "该读者不存在!" << endl;
break;
}
cout << "请输入名字:";
cin >> readername;
r->SetReaderName(readername);
cout << "读者名字修改成功!" << endl;
break;
}
case'3':
{
r = QueryID(readerID);
if (r == 0)
{
cout << "该读者不存在!" << endl;
break;
}
r->DeleteReader();
cout << "删除成功!" << endl;
break;
}
case'4':
{
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "**** 图书管理系统:读者菜单(查询读者) ****" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "** 1.按照编号查找 2.按照名字查找 **" << endl;
cout << "** **" << endl;
cout << "** **" << endl;
cout << "** 0.返回上一级目录 **" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cin >> choice2;
switch (choice2)
{
case'1':
{
cout << "请输入读者编号:";
cin >> readerID;
//判断有没有这个人
r = QueryID(readerID);
if (r == 0)
{
cout << "该读者不存在!" << endl;
break;
}
cout << setw(10) << "读者编号" << setw(10) << "读者姓名" << setw(10) << "已借书编号:" << setw(10);
r->DisReader();
break;
}
case'2':
{
cout << "请输入读者姓名:";
cin >> readername;
//判断有没有这个人
r = QueryReaderName(readername);
if (r == 0)
{
cout << "该读者不存在!" << endl;
break;
}
cout << setw(10) << "读者编号" << setw(10) << "读者姓名" << setw(10) << "已借书编号:" << setw(10);
r->DisReader();
break;
}
case'0':
break;
}
break;
}
case'5':
cout << setw(10) << "读者编号" << setw(10) << "读者姓名" << setw(10) << "已借书编号:" << setw(10) << endl;;
DisReader();
break;
case'6':
ClearReaderDate();
break;
case'0':
break;
}
break;
break;
}
}
#pragma once
#include "pch.h"
#include <iostream>
#include <string.h>
#include <fstream>
#include <string>
#include <iomanip>
using namespace std;
//const int MaxBook = 100;//最大的图书量
//const int MaxReader = 100;//最大的读者数
//const int MaxBorrow = 5;//每次最多可以借书的数量
//主界面
class MainDesk
{
public:
//登录函数
int Register()
{
int k = 0;
choice1 = 1;
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "**** 图书管理系统 ****" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "** 欢迎使用图书管理系统 **" << endl;
cout << "** **" << endl;
while (choice1 != '0')
{
k++;
cout << "** **" << endl;
cout << "** 1.登录账号 0.退出系统 **" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cin >> choice1;
switch (choice1)
{
case'1':
cout << "请输入用户名和密码:" << endl;
cout << "账号:";
cin >> user;
cout << "密码:";
cin >> password;
//设置初始密码
if (user == 123 && password == 123)
{
cout << "登录成功!" << endl;
//进入主界面
EnterDesk();
break;
}
//判定输入错误次数
if (user < 10000 || user>1 || user != password)
{
cout << "登录失败! 你还有:" << 3 - k << "次登录机会" << endl;
if (k > 3)
{
cout << "次数已经用完,程序自动退出" << endl;
return 1;
}
continue;
}
break;
case'0':
break;
}
return 1;
}
return 0;
}
//主界面
void EnterDesk()
{
while (choice2 != 0)
{
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "**** 图书管理系统主界面 ****" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cout << "**************************************************************" << endl;
cout << "** **" << endl;
cout << "** 1.图书信息 2.读者信息 **" << endl;
cout << "** 3.图书借阅 4.图书归还 **" << endl;
cout << "** **" << endl;
cout << "** 0.退出系统 **" << endl;
cout << "** **" << endl;
cout << "**************************************************************" << endl;
cout << "请输入0-4" << endl;
cin >> choice2;
switch (choice2)
{
case'1':
Bookdb.bookdate();
break;
case'2':
Readerdb.ReaderDate();
break;
case'3':
{
cout << "请输入借书读者的编号:" << endl;
cin >> readerID;
r = Readerdb.QueryID(readerID);
if (r == 0)
{
cout << "此读者不存在,无法借书!" << endl;
break;
}
cout << "请输入要借书籍的编号:" << endl;
cin >> bookID;
b = Bookdb.Query1(bookID);
if (b == 0)
{
cout << "此书籍不存在,无法借书!" << endl;
break;
}
if (b->BorrowBook() == 0)
{
cout << "该图书已被借完,无法借书!" << endl;
break;
}
cout << "读者借书成功!" << endl;
r->BorrowBook(b->GetBookID());//把ID值传给这个读者
//Bookdb BorrowBook(bookID) = b->GetBookID();
//strcpy(r->BorrowBook, b->GetBookID());
break;
}
case'4':
{
cout << "请输入还书读者的编号:" << endl;
cin >> readerID;
r = Readerdb.QueryID(bookID);
if (r == 0)
{
cout << "此读者不存在,无法还书!" << endl;
break;
}
cout << "请输入要还书籍的编号:" << endl;
cin >> bookID;
b = Bookdb.Query1(bookID);
if (b == 0)
{
cout << "此书籍不存在,无法还书!" << endl;
break;
}
cout << "读者还书成功!" << endl;
b->ReturnBook();
r->ReturnBook(b->GetBookID());
break;
}
case'0':
break;
}
if (choice2 == '0')
{
break;
}
}
}
private:
char choice1=1;
char choice2=1;
char choice3=1;
double user, password;
int bookID, readerID;
Book *b;//书籍
BookDateBase Bookdb;//
Reader *r;//读者
ReaderDatebase Readerdb;//
};
联系客服