資源簡介
完整的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)?< setw(15)?< setw(15)?< setw(15)?< ????if?(Borrowed!=0)?
{
if?(Booking==0)?cout?< else?cout?< }
cout?< return?0;
}
?
int?book::Book_delete()???????????????????????//刪除書目
{
if?(Borrowed?>?0)?
{
for?(int?i?=?0;?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投影程序
評論
共有 條評論