资源简介
完整的C++图书馆管理系统程序,初学者的良好练习题目

代码片段和文件信息
#include “book.h“
using namespace std;
int book::Book_bo(int readId) //借书函数
{
if (Borrowed == -1)
{ cout <<“\n\t对不起,您所要借的书不存在 !!!\n“ ; return 0; }
if (Borrowed != 0)
{
if (Booking && (Borrowed == readId)) Booking = 0;
else { cout <<“\n\t您所要借的书已被借走或预约了 !!!\n“ ;return 0; }
}
else Borrowed = readId;
return 1;
}
int book::Book_re(int readId) //还书函数
{
if (Borrowed == -1) { cout <<“\n\t您所要还的书不存在 !!!\n“ ; return 0; }
if (Borrowed != readId) { cout <<“\n\t您并没有借这本书 !!!\n“; return 0; }
else Borrowed = 0;
return 1;
}
int book::Book_ap(int readId) //预约函数
{
if (Borrowed == -1)
{ cout <<“\n\t对不起,您所要借的书不存在 !!!\n“ ; return 0; }
if (Borrowed != 0)
{
if (Booking && (Borrowed == readId))
{ cout <<“\n\t对不起 您已经预约此书 !!!\n“;
return 0; }
else { cout <<“\n\t对不起 此书已被借走或预约 !!!\n“ ;return 0; }
}
else { Borrowed = readId; Booking = 1; }
return 1;
}
int book::Book_add(const string s1 const string s2const string s3const string s4int s5int s6int s7) //初始化图书信息
{
ISBN = s1; Name = s2;
writer = s3; Index = s4;
Borrowed = s5; BookID = s6;
Booking = s7;
return 0;
}
int book::Display() //输出书目的相关信息
{
cout << setw(10) << BookID <<
setw(10) << ISBN <<
setw(15) << Name <<
setw(15) << writer <<
setw(15) << Index;
if (Borrowed!=0)
{
if (Booking==0) cout << setw(10) << “已借“;
else cout << setw(10) << “已预约“;
}
cout << endl;
return 0;
}
int book::Book_delete() //删除书目
{
if (Borrowed > 0)
{
for (int i = 0; i < USER.size(); i++)
if (Borrowed==USER[i].UserID)
{
cout <<“\n\t您不能删除这本书,因为这本书已被人借或预约\n“;
return 0;
} //如果这本书有人借,就无法删除
}
Borrowed = - 1;
cout <<“\n\t您已经成功删除此书!\n“;
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2062 2008-12-28 15:10 library\book.cpp
文件 928 2008-12-28 15:09 library\book.h
文件 540 2008-12-28 15:22 library\operate3.cpp
文件 115712 2008-12-28 15:34 library\Debug\vc60.idb
文件 1644943 2008-12-18 16:08 library\Debug\DataBook.txt
文件 115 2003-12-27 22:56 library\Debug\DataUser.txt
文件 1644943 2008-12-18 16:08 library\Debug\InitBook.txt
文件 115 2003-12-27 22:56 library\Debug\InitUser.txt
文件 143360 2008-12-28 15:34 library\Debug\vc60.pdb
文件 2546376 2008-12-28 15:34 library\Debug\library.pch
文件 158914 2008-12-28 15:34 library\Debug\book.obj
文件 465677 2008-12-28 15:34 library\Debug\main.obj
文件 112476 2008-12-28 15:34 library\Debug\operate1.obj
文件 114874 2008-12-28 15:34 library\Debug\operate2.obj
文件 35971 2008-12-28 15:34 library\Debug\operate3.obj
文件 141640 2008-12-28 15:34 library\Debug\operate4.obj
文件 149628 2008-12-28 15:34 library\Debug\operate5.obj
文件 149403 2008-12-28 15:34 library\Debug\operate6.obj
文件 175601 2008-12-28 15:34 library\Debug\user.obj
文件 1091348 2008-12-28 15:34 library\Debug\library.ilk
文件 725079 2008-12-28 15:34 library\Debug\library.exe
文件 1287168 2008-12-28 15:34 library\Debug\library.pdb
文件 101 2008-12-28 13:34 library\operate6.h
文件 1644943 2008-12-18 16:08 library\InitBook.txt
文件 115 2008-12-22 13:00 library\InitUser.txt
文件 5243 2008-12-28 15:05 library\main.cpp
文件 539 2003-12-27 22:40 library\library.dsw
文件 82944 2008-12-28 15:34 library\library.ncb
文件 1216 2008-12-28 15:34 library\operate2.cpp
文件 2130 2008-12-28 15:34 library\library.plg
............此处省略22个文件信息
- 上一篇:隐马尔可夫模型与异常检测的论文
- 下一篇:MFC投影程序
相关资源
- 国际象棋的qt源代码
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
- c++多边形交并差运算
评论
共有 条评论