资源简介
完整的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投影程序
相关资源
- 浙江大学OOP大程 C++ 五子棋设计 MFC
- MFC图书馆管理系统
- VC++UDP网络聊天程序
- Visual C++ 2015 build tools update 3
- vcredist_x86.rar
- 简单的vc++实现winsock点对点通信
- c++围棋可执行文件
- VC计算器 用VC++设计一个计算器,功能
- DDE server VC++
- 孙鑫VC++深入详解教程(全20讲)PPT讲
- 学生社团管理系统 c++ MFC 课程设计
- C++ FTP 源码
- hdf5.h c++ 库文件
- vc++2008 速成版
- 北邮C++小学期坦克大战代码及报告
- C++、qt环境下的C/S聊天器
- 16C++MFC课程设计之吹泡泡游戏
- 白话C++全本23章
- C++做的Ftp服务器
- C++程序设计教程第二版实验指导-钱能
- 基于循环双向链表的大整数计算器c
- C++上机考试系统包括100道题
- c++实现频谱分析,可用于对傅里叶变
- C++(OPENCV)摄像头标定代码带图片O
- 基于winPcap开发嗅探器c++
- C++课程设计之水电煤气管理系统
- DEV C++ 5.0 官方原版
- C-Minus编译器
- dev c++中文安装包
- C++实现指针式时钟Sample
评论
共有 条评论