C语言图书管理系统注册功能,图书管理系统的c语言源程序

news/2024/7/3 0:16:19

/*****************************************************************************************/#include #include #include #include /输入/输出文件流类using namespace std;const int maxr=100;/最多的读者const int maxb=100;/最多的图书const int maxbor=5;/每位读者最多借五本书/读者类,实现对读者的信息的描述class reader { private: int tag; /删除标记 1:已删 0:未删 int no; /读者编号 char name[10]; /读者姓名 int borbook[maxbor];/所借图书 public: reader() {} char *getname() {return name;} /获取姓名 int gettag() {return tag;} /获取删除标记 int getno() {return no;} /获取读者编号 void setname(char na[]) /设置姓名 { strcpy(name,na); } void delbook(){ tag=1; }/设置删除标记 1:已删 0:未删 void addreader(int n,char *na)/增加读者 { tag=0; no=n; strcpy(name,na); for(int i=0;i> choice; switch (choice) { case ‘1‘: cout > readerid; cout > rname; addreader (readerid,rname); break; case ‘2‘: cout > readerid; r=query(readerid); if (r==null) { cout rname; r->setname(rname); break; case ‘3‘: cout > readerid; r=query(readerid); if (r==null) { cout delbook(); break; case ‘4‘: cout > readerid; r=query(readerid); if (r==null) { cout disp(); break; case ‘5‘: disp(); break; case ‘6‘: clear(); break; default:cout choice; switch (choice) { case ‘1‘: cout bookid; cout bname; addbook(bookid,bname); break; case ‘2‘: cout bookid; b=query(bookid); if (b==null) { cout bname; b->setname(bname); break; case ‘3‘: cout bookid; b=query(bookid); if (b==null) { cout delbook(); break; case ‘4‘: cout bookid; b=query(bookid); if (b==null) { cout disp(); break; case ‘5‘: disp(); break; case ‘6‘: clear(); break; default:cout choice; switch (choice) { case ‘1‘: cout >readerid; cout >bookid; r=readerdb。

query(readerid);/按编号查找 if (null==r) { cout borrowbook()==0) { cout borrowbook(b->getno()); break; case ‘2‘: cout>readerid; cout >bookid; r=readerdb。

query(readerid); if (r==null) { cout retbook(b->getno()); break; case ‘3‘: okdata(); break; case ‘4‘: aderdata(); break; default:cout<

全部


http://lihuaxi.xjx100.cn/news/239683.html

相关文章

初学者css常见问题_5分钟内学习CSS Grid-初学者教程

初学者css常见问题Grid layouts are fundamental to the design of websites, and the CSS Grid module is the most powerful and easiest tool for creating it. I personally think it’s a lot better than for example Bootstrap (read why here).网格布局是网站设计的基础…

配置文件的简单使用

常见的配置文件格式:1.properties里面内容的格式 keyvalue2.xml后期详细解释若我们的配置文件为properties,并且放在src目录下.我们可以通过 ResourceBundle工具快速获取里面的配置信息使用步骤:1.获取ResourceBundle 对象:static ResourceBundle getBundle("文件名称不带…

解决:无法创建该DNS 服务器的委派

第一次安装AD DNS的时候&#xff0c;你可能遇到以下的提示&#xff0c;无法创建该DNS 服务器的委派&#xff0c;这是一个提示&#xff0c;而不是一个报错。 以下是详细的说明。 将具有 DNS 服务器的新 Windows Server 2008 或 Windows Server 2008 R2 域控制器安装到 treyr…

npm构建脚本_NPM脚本简介

npm构建脚本by Mohammed Ajmal Siddiqui由Mohammed Ajmal Siddiqui NPM脚本简介 (Introduction to NPM Scripts) NPM scripts are among my favorite features of NPM. They are simple. They reduce the need for tools. Hence they reduce the number of configuration file…

String、StringBuffer与StringBuilder之间区别 (转载)

最近学习到StringBuffer&#xff0c;心中有好些疑问&#xff0c;搜索了一些关于String&#xff0c;StringBuffer&#xff0c;StringBuilder的东西&#xff0c;现在整理一下。 关于这三个类在字符串处理中的位置不言而喻&#xff0c;那么他们到底有什么优缺点&#xff0c;到底什…

鸿蒙系统能内测吗,鸿蒙系统内测用户:使用体验已经超越ios

首先&#xff0c;鸿蒙流畅度堪比iOS&#xff0c;如同德芙巧克力一样非常丝滑&#xff0c;各种界面切换毫无卡顿。鸿蒙是万物互联的基础&#xff0c;在与其他设备联动上&#xff0c;使用了freebuds pro和magic wathc2&#xff0c;状态栏就能直接切换耳机&#xff0c;非常顺畅&am…

SQL to Elasticsearch java code

把Elasticsearch当成Database用&#xff0c;因为Elasticsearch不支持SQL&#xff0c;就需要把SQL转换成代码实现。 1.按某个field group by查询count SELECT fieldA, COUNT(fieldA) from table WHERE fieldC "hoge" AND fieldD "huga" AND fieldB…

调试代码遗留_陷入遗留代码地狱吗? 这里有一些想法可以帮助您处理情况

调试代码遗留by Felipe Lopes通过Felipe Lopes 陷入遗留代码地狱吗&#xff1f; 这里有一些想法可以帮助您处理情况 (Stuck in legacy code hell? Here are some few thoughts to help you manage the situation) I’m gonna tell you a little story about how I ended up i…