完整的C++图书馆管理系统程序,初学者的良好练习题目
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2062 2008-12-28 15:10 libraryook.cpp
文件 928 2008-12-28 15:09 libraryook.h
文件 540 2008-12-28 15:22 libraryoperate3.cpp
文件 115712 2008-12-28 15:34 libraryDebugvc60.idb
文件 1644943 2008-12-18 16:08 libraryDebugDataBook.txt
文件 115 2003-12-27 22:56 libraryDebugDataUser.txt
文件 1644943 2008-12-18 16:08 libraryDebugInitBook.txt
文件 115 2003-12-27 22:56 libraryDebugInitUser.txt
文件 143360 2008-12-28 15:34 libraryDebugvc60.pdb
文件 2546376 2008-12-28 15:34 libraryDebuglibrary.pch
文件 158914 2008-12-28 15:34 libraryDebugook.obj
文件 465677 2008-12-28 15:34 libraryDebugmain.obj
文件 112476 2008-12-28 15:34 libraryDebugoperate1.obj
文件 114874 2008-12-28 15:34 libraryDebugoperate2.obj
文件 35971 2008-12-28 15:34 libraryDebugoperate3.obj
文件 141640 2008-12-28 15:34 libraryDebugoperate4.obj
文件 149628 2008-12-28 15:34 libraryDebugoperate5.obj
文件 149403 2008-12-28 15:34 libraryDebugoperate6.obj
文件 175601 2008-12-28 15:34 libraryDebuguser.obj
文件 1091348 2008-12-28 15:34 libraryDebuglibrary.ilk
文件 725079 2008-12-28 15:34 libraryDebuglibrary.exe
文件 1287168 2008-12-28 15:34 libraryDebuglibrary.pdb
文件 101 2008-12-28 13:34 libraryoperate6.h
文件 1644943 2008-12-18 16:08 libraryInitBook.txt
文件 115 2008-12-22 13:00 libraryInitUser.txt
文件 5243 2008-12-28 15:05 librarymain.cpp
文件 539 2003-12-27 22:40 librarylibrary.dsw
文件 82944 2008-12-28 15:34 librarylibrary.ncb
文件 1216 2008-12-28 15:34 libraryoperate2.cpp
文件 2130 2008-12-28 15:34 librarylibrary.plg
............此处省略22个文件信息
#include “book.h“
using namespace std;
int book::Book_bo(int readId) //借书函数
{
if (Borrowed == -1)
{ cout <<“
对不起,您所要借的书不存在 !!!
“ ; return 0; }
if (Borrowed != 0)
{
if (Booking && (Borrowed == readId)) Booking = 0;
else { cout <<“
您所要借的书已被借走或预约了 !!!
“ ;return 0; }
}
else Borrowed = readId;
return 1;
}
int book::Book_re(int readId) //还书函数
{
if (Borrowed == -1) { cout <<“
您所要还的书不存在 !!!
“ ; return 0; }
if (Borrowed != readId) { cout <<“
您并没有借这本书 !!!
“; return 0; }
else Borrowed = 0;
return 1;
}
int book::Book_ap(int readId) //预约函数
{
if (Borrowed == -1)
{ cout <<“
对不起,您所要借的书不存在 !!!
“ ; return 0; }
if (Borrowed != 0)
{
if (Booking && (Borrowed == readId))
{ cout <<“
对不起 您已经预约此书 !!!
“;
return 0; }
else { cout <<“
对不起 此书已被借走或预约 !!!
“ ;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 <<“
您不能删除这本书,因为这本书已被人借或预约
“;
return 0;
} //如果这本书有人借,就无法删除
}
Borrowed = - 1;
cout <<“
您已经成功删除此书!
“;
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2062 2008-12-28 15:10 libraryook.cpp
文件 928 2008-12-28 15:09 libraryook.h
文件 540 2008-12-28 15:22 libraryoperate3.cpp
文件 115712 2008-12-28 15:34 libraryDebugvc60.idb
文件 1644943 2008-12-18 16:08 libraryDebugDataBook.txt
文件 115 2003-12-27 22:56 libraryDebugDataUser.txt
文件 1644943 2008-12-18 16:08 libraryDebugInitBook.txt
文件 115 2003-12-27 22:56 libraryDebugInitUser.txt
文件 143360 2008-12-28 15:34 libraryDebugvc60.pdb
文件 2546376 2008-12-28 15:34 libraryDebuglibrary.pch
文件 158914 2008-12-28 15:34 libraryDebugook.obj
文件 465677 2008-12-28 15:34 libraryDebugmain.obj
文件 112476 2008-12-28 15:34 libraryDebugoperate1.obj
文件 114874 2008-12-28 15:34 libraryDebugoperate2.obj
文件 35971 2008-12-28 15:34 libraryDebugoperate3.obj
文件 141640 2008-12-28 15:34 libraryDebugoperate4.obj
文件 149628 2008-12-28 15:34 libraryDebugoperate5.obj
文件 149403 2008-12-28 15:34 libraryDebugoperate6.obj
文件 175601 2008-12-28 15:34 libraryDebuguser.obj
文件 1091348 2008-12-28 15:34 libraryDebuglibrary.ilk
文件 725079 2008-12-28 15:34 libraryDebuglibrary.exe
文件 1287168 2008-12-28 15:34 libraryDebuglibrary.pdb
文件 101 2008-12-28 13:34 libraryoperate6.h
文件 1644943 2008-12-18 16:08 libraryInitBook.txt
文件 115 2008-12-22 13:00 libraryInitUser.txt
文件 5243 2008-12-28 15:05 librarymain.cpp
文件 539 2003-12-27 22:40 librarylibrary.dsw
文件 82944 2008-12-28 15:34 librarylibrary.ncb
文件 1216 2008-12-28 15:34 libraryoperate2.cpp
文件 2130 2008-12-28 15:34 librarylibrary.plg
............此处省略22个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)