好好学习,天天向上,写范文网欢迎您!
当前位置:首页 > > 综合范文 > 正文

数据结构课程设计—西文图书管理系统3篇(图书管理系统数据库设计oracle)

2022-10-28 12:10:37综合范文

  下面是范文网小编整理的数据结构课程设计—西文图书管理系统3篇(图书管理系统数据库设计oracle),以供借鉴。

数据结构课程设计—西文图书管理系统3篇(图书管理系统数据库设计oracle)

数据结构课程设计—西文图书管理系统1

  秦皇岛职业技术学院

  课程设计论文

  设计题目: 图书管理系统

  学生姓名:蔡昆

  指导教师:刘学超,李旺彦

  专业名称: 计算机应用技术专业

  所在院系:信息工程系

  2007 年 7 月5日

  摘要

  随着人类社会的发展,人类对知识的需求也不断地增长。在这种形势下,书籍就渐渐地成为人们获取并增长知识的主要途径,而图书馆就自然而然地在人们的生活中占据了一定的位置,如何科学地管理图书馆不但关系到读者求知的方便程度,也关系到图书馆的发展,因此,开发一套完善的图书馆管理系统就成不可少了,本文介绍了在Visual 环境下采用“自上而下地总体规划,自下而上地应用开发”的策略开发本系统的详细过程。图 书 管 理 系 统是典型的信息管理系统,其开发主要包括后台数据库的建立和维护以及前端应用程序的开发两个方面。对于前者要求建立起数据一致性和完整性强、数据安全性好的库。而对于后者则要求应用程序功能完备,易使用等特点。

  文章详细介绍了图书管理信息系统的系统分析部分;统设计部

  分主要介绍了系统功能设计和数据库设计;系统实现部分列出了几个主要的程序框图,并附带了一些主要的窗口和程序。本系统界面友好,操作简单,比较实用。

  关键字:图书管理、Visual 、数据库、借阅

  Abstract

  With the development of society , Mankind need more knowledge

  Also constantly increase, Under this f situation, book gradually become the main path to obtain the knowledge of life, and library naturally

  occupied in peoplecertainly position, how science ground the

  management library not only relate to the convenient degree that the

  reader beg to know, but also relate to the library that strategy of

  development, therefore, develop the management system of a perfect library can't little, this text introduced under the Visual the

  environment adoption" from top to bottom total

  management system of library is a goodinformation system,it

  includes two sections,such as buliding and protecting and system of

the frist one ,it wants to build a good and a safty the second one ,it wants to use article emphasizes on three system analysis

  section of library management system design section

  mainly focuses on system function design and data base

  the system realization section has provided several major program

  charts, together with the main windows and economical

  And pragmatic system has explicit interface, with simple : information management system of library ,VB application, Borrowing, the system of number

  目录

  第1章 选题及本次课程设计的任务 ····································································· 1

  查找资料 ········································································································· 1

  选题 ················································································································· 1

  总结数据、明确任务 ····················································································· 1

  本次设计的重大意义 ····················································································· 4

  本章小节 ······································································································· 18

  第2章设计实现的详细步骤 ··················································································· 5

·························································································································· 5

·························································································································· 8

························································································································ 13

  本章小节 ······································································································· 18

  第3章 设计中遇到的重点及难点 ······································································· 19

························································································································ 19

························································································································ 19

························································································································ 21

  本章小节 ······································································································· 37

  第4章 本次设计中存在不足与改良方案 ··························································· 38

························································································································ 38

························································································································ 38

·················································································································· 39

·················································································································· 40

  本章小节 ······································································································· 4

  5第一章

  查找资料

  借助现代信息技术和管理理论,建立管理信息系统是当今社会的重要趋势。时代的进步,计算机越来越广泛的运用,使很多原本由手工操作的管理,慢慢由计算机代替,而且日加完善。图书管理系统就是其中一个典型的例子,由早先的手工操作管理,提升为计算机管理,大大的节约了人力物力资源。

  实行电子化的图书管理,让人力资源管理人员从繁重琐碎的案头工作解脱出来,完成更重要的工作。图书管理系统就是为了解决和减轻繁琐的手工管理,使图书馆可以上升到一个完善的电子话,信息话管理。

选题

  图书馆管理系统是典型的信息管理系统,其开发主要包括后台

  数据库的建立和维护以及前端的应用程序的开发两个方面。对于前者要求建立数据的一致性和完整性,对于后者则要求应用程序功能的完备,易用等的特点。基于上述考虑本系统主要利用VB 6作前端的应用开发工具,利用SQL Server2000作为后台的数据库,利用WINDOWS作为系统平台开发的图书管理系统。另外本图书馆管理系统利用软件工程化思想和方法,总体上是采用结构化生命法进行系统分析和设计的,而系统实现等步骤则采用了原型法和面对对象的方法。所以根据这些选了图书管理系统

  总结数据,明确任务

(1)可以实现图书的登记、借阅和赔偿的管理。

(2)可以实现对图书的各种信息的查询,包括逐个浏览,以及对图书信息的增加、删除和编辑操作。另外,可以根据输入的信息来检索某个图书的信息。

(3)可以实现对管理人员的投诉管理。

(4)可以实现对值班人员的管理。

(5)可以实现对数据的维护即数据压缩,数据备份,数据清理等。

(6)可以实现对用户名的增加,密码的修改的管理。

(7)可以实现对读者信息的查询和统计。

数据结构课程设计—西文图书管理系统2

《数据结构》

  课程设计报告书

  一.课程设计题目

  图书借阅管理系统

  二.课程设计内容

  实现图书管理信息系统的设计

(一)管理员功能:

①登录:输入管理员密码,若密码错误则不得执行管理员操作。

②添加新书:增加新的图书资料,同时需检查新书的图书编号是否已存在于原图书资料中,若已存在则应取消添加或提示重新输入。

③修改图书:通过编号查询该图书资料,若该编号存在,则显示已有信息,允许修改,否则提示 无该图书信息。

④删除图书:通过编号查询该图书资料,若该编号存在,则显示已有信息,允许删除,否则提示无该图书信息。删除对象包括该图书资料以及“图书状态”和“借阅人”中与此书相关的所有记录。

⑤查找图书:

  A.按书号查找:通过编号查询该图书资料,若该编号存在,则显示图书信息,否则提示无该图书信息。

  B.按书名查找:通过书名查询该图书资料,若该编号存在,则显示图书信息,否则提示无该图书信息。

  c.按作者查找:通过作者查询该图书资料,若该编号存在,则显示图书信息,否则提示无该图书信息。

⑥查看全部图书:显示所有图书资料,包括书号、书名、作者、状态和借阅人等信息。

⑦修改读者:通过姓名查询该读者信息,若该姓名存在,则显示已有信息,允许修改,否则提示无该读者信息。

⑧删除读者:通过姓名查询该读者信息,若该姓名存在,则显示已有信息,允许删除,否则提示无该读者信息。删除对象包括该读者姓名、班级、电话以及“图书状态”和“借阅人”中与此人相关的所有记录。

⑨查看所有读者:显示所有读者资料,包括姓名、班级、电话等信息。

(二)读者功能:

①登录:输入读者姓名,若未经注册则不得进入读者服务界面。②注册:新用户经注册方可登录系统并使用读者服务功能。③借书:

  A.输入所需图书编号,判断该编号是否存在,若不存在则提示重新输入。

  B.若所输入图书编号存在,则判断该书籍是否已被借出,若已借则不允许执行借书操作。

  c.若所输入图书未借,则提示输入读者姓名,判断所输入读者姓名是否存在,若不存在则提示重新输入。D.若读者姓名存在,则允许执行借书操作。

  e.借书处理包括在“图书状态”中加上“已借”标记。④还书:

  A.输入所借书编号,判断该编号是否存在,若不存在则提示重新输入。B.判断该书是否已借出,若未借则不允许执行还书操作。C.借书处理包括在“图书状态”中加上“未借”标记。⑤查询图书:

  A.按书号查找:通过编号查询该图书资料,若该编号存在,则显示图书信息,否则提示无该图书信息。

  B.按书名查找:通过书名查询该图书资料,若该编号存在,则显示图书信息,否则提示无该图书信息。

  c.按作者查找:通过作者查询该图书资料,若该编号存在,则显示图书信息,否则提示无该图书信息。

⑥查看借阅情况:输入读者姓名,若该姓名不存在则提示重新输入,若该姓名存在则显示该读者借阅信息。

  三.算法设计

  1.流程图(部分示例)

①管理员登录

②读者登录

③读者借阅图书

④管理员或读者按书名查找图书

  2.代码实现

#include #include

#include #include //文件流 #include <> #define BookFile “”

//将字符串BookFile替换原文件中的宏名称book #define ReaderFile “” using namespace std;//**********读者结构体,用于存放读者基本信息********** class Reader {

  private:

  char rname[10];

  char rclass[10];

  char rtel[10];public:

  reader()//构造函数,实现数据初始化

{strcpy(rname,“");strcpy(rclass,”“);strcpy(rtel,”“);} //初始化

  void set_rname(char *rn)//设置读者姓名

{strcpy(rname,rn);} //将rn的字符复制给rname

  char * get_rname()//获得读者姓名

{return rname;} //返回rname的值

  void set_rclass(char *rc)//设置班级

{strcpy(rclass,rc);}

  char *get_rclass()

//获得班级

{return rclass;}

  void set_rtel(char *rt)

//设置电话

{strcpy(rtel,rt);}

  char *get_rtel()

//获得电话

{return rtel;}

  void copy(Reader m)//读者Reader结构体copy函数

{strcpy(rname,_rname());strcpy(rclass,_rclass());strcpy(rtel,_rtel());} };//*********读者管理结构体,实现对读者用户的管理********* class ReaderManage {

  reader readers[50];//定义读者结构体数组对象,最多50位

  int length;

  void readFile()

//读取读者文件函数

{

  ifstream fread;//定义输入文件流对象fread

  length=0;

//计数

  if(!fread)

{cout<<”读取磁盘文件失败!“<

(ReaderFile,ios::binary);//使文件流与文件关联,以二进制方式打开

  int i=0;

  While((((char *)&readers[i],sizeof(Reader))))//计算并返回所占字节数

  i++;

  length=i;

();//关闭磁盘文件

} void saveFile()//保存读者文件

{

  ofstream fwrite;

//定义输出文件流对象fwrite

  if(!fwrite)

{cout<<”文件保存失败!n“;exit(1);}

(ReaderFile,ios::binary);//使文件流与文件关联,以二进制方式打开

((char *)readers,length*sizeof(Reader));//计算并返回所占字节数

();//关闭磁盘文件

} public:

  readerManage()//构造函数,读取读者文件

{readFile();}

~ReaderManage()//析构函数,保存读者文件

{saveFile();}

  void add_reader(Reader r)//添加读者用户函数

{

  if(length>=50)

{cout<<”对不起,注册人数已满!n“;return;}

  readers[length].copy(r);//调用读者结构体copy函数

  length++;} int search(char *rn)//按姓名查找读者函数

{

  for(int i=0;i

  if(strcmp(readers[i].get_rname(),rn)==0)//判断是否相等

  return i;

  return-1;

} bool revise(Reader reader,int i)//修改读者资料函数

{

  readers[i].copy(reader);//调用读者结构体cpoy函数

  return true;} void delete_reader(int index)//删除读者函数

{

  for(int i=index;i

  readers[i].copy(readers[i+1]);//用后面的地址覆盖前面的地址

  length--;} bool log_reader(Reader r)//登录时判断读者用户是否存在函数,相当于遍历

{

  for(int i=0;i

  if(strcmp(readers[i].get_rname(),_rname())==0)

  return true;

  return false;

} void reg_reader()//注册用户函数

{

  char n[10];

//姓名name

  char c[10];

//班级class

  char t[10];

//电话tel

  reader reader;

  cout<<”nt请输入您的姓名:“;

  cin>>n;

  cout<<”nt请输入您的所在班级:“;

  cin>>c;

  cout<<”nt请输入您的联系电话:“;

  cin>>t;

  _rname(n);//调用读者结构体设置读者姓名函数

  _rclass(c);//调用读者结构体设置读者班级函数

  _rtel(t);//调用读者结构体设置联系电话函数

  Add_reader(reader);//调用读者结构体添加读者函数

  cout<<”nt注册成功!“;} void show_reader()//不带参的显示读者信息函数

{ cout<<”n ☆☆☆☆☆☆☆☆☆☆☆☆读★★者★★信★★息★★列★★表☆☆☆☆☆☆☆☆☆☆☆nn“;

  cout<<”姓名ttt班级ttt电话n“;

  for(int i=0;i

{

  cout<

  cout<<”ttt“<

  cout<<”ttt“<

} } void show_reader(int i)//带参的显示读者信息函数

{

  cout<<”n ☆☆☆☆☆☆☆☆☆☆☆☆读★★者★★信★★息★★列★★表☆☆☆☆☆☆☆☆☆☆nn“;

  cout<<”姓名ttt班级ttt电话n“;

  cout<

  cout<<”ttt“<

  cout<<”ttt“<

}

};

//********书籍结构体,用于存放书籍基本信息******** class Book { private:

  char bnum[10];

//书号

  char bname[20];

//书名

  char bauthor[10];

//作者

  char rname[10];

//借阅人 public: int tag;

//状态标记判断指标(已借/在架)Book()

//构造函数初始化信息

{strcpy(bnum,”“);strcpy(bname,”“);strcpy(bauthor,”“);strcpy(rname,”“);tag=0;}

  void set_bnum(char *no)

//设置书号

{strcpy(bnum,no);}

//把字符串no中的字符复制到字符串bnum中

  char *get_bnum()

//获得书号

{

  return bnum;}

//返回值为bnum

  void set_bname(char *n)

//设置书名

{strcpy(bname,n);}

  char *get_bname()

//获得书名

{return bname;}

  void set_bauthor(char *a)

//设置作者

{strcpy(bauthor,a);}

  char * get_bauthor()

//获得作者姓名

{return bauthor;}

  void set_tag(int t)

//状态设置

{tag=t;}

  void set_rname(char *rn)

//设置借阅人

{strcpy(rname,rn);}

  char *get_rname()

//获得借阅人姓名

{return rname;}

  void show_tag()

//显示图书状态

{

  if(tag==1)

{cout<<”已借“;}

  else

{cout<<”在架“;}

}

  void copy(Book m)

//Book结构体copy函数

{

  strcpy(bnum,_bnum());

//将获得书号函数里的返回值里的字符复制到bnum

  strcpy(bname,_bname());

  strcpy(bauthor,_bauthor());

  tag=0;

} };//**********书籍管理结构体,实现管理书籍功能********** class BookManage { private:

  Book books[100];

//定义Book书籍结构体数组对象,最大容量100本

  int length;

  void saveFile()

//保存书籍文件

{

  ofstream fwrite;//定义输出文件流ofstream结构体对象fwrite

  if(!fwrite)

{cout<<”文件保存失败!n“;exit(1);

}

(BookFile,ios::binary);//使文件流与文件建立关联,以二进制方式打开

((char *)books,length*sizeof(Book));//计算并返回所占字节数

();

//关闭磁盘文件

} void readFile()

//读取书籍文件

{

  ifstream fread;//定义输入文件流对象fread

  length=0;

  if(!fread)

{cout<<”文件读取失败!“<

  Book temp;

//定义书籍结构体临时对象temp

  int i=0;

(BookFile ,ios::binary);//使文件流与文件建立关联,以二进制方式打开

  While((((char *)&books[i],sizeof(Book))))

  i++;

//每读完一次,指针后移一位,直到不能读出正确结果为止

  length=i;

();} public:

  BookManage()

//构造函数,读取磁盘文件

{

  length=0;

//从头读起,计数,最大100

  readFile();

//调用读取文件函数

}

~BookManage()

//析构函数,保存磁盘文件

{

  saveFile();

//调用保存文件函数

}

  Bool add(Book book)

//添加图书资料

{

  if(length>=100)

{ cout<<”对不起,储存已满,您无法继续添加!n“;

  return-1;

}

  else

{

  Books[length].copy(book);//调用书籍结构体copy函数

  length++;

  return(length-1);

} } int bnu_search(char *bnu)

//按书号查找书籍

{

  for(int i=0;i

  if(strcmp(books[i].get_bnum(),bnu)==0)//字符串比较,判断是否相等

  return i;

  return-1;

} int bna_search(char *bna)

//按书名查找书籍

{

  for(int i=0;i

  if(strcmp(books[i].get_bname(),bna)==0)//判断

  return i;

  return-1;

} int bau_search(char *bau)//按作者查找书籍

{

  for(int i=0;i

  if(strcmp(books[i].get_bauthor(),bau)==0)//判断

  return i;

  return-1;

}

  int rn_search(char *rn)//按借阅人查找书籍

{

  for(int i=0;i

  if(strcmp(books[i].get_rname(),rn)==0)//判断

  return i;

  return-1;

}

  void revise(Book book,int i)//带参的修改书籍函数

{books[i].copy(book);} //调用Book结构体copy函数

  void deleteBook(int index)//带参的删除书籍资料函数

{

  for(int i=index;i

  Books[i].copy(books[i+1]);//用后面的地址将当前的地址覆盖

  length--;

} void show_book()//不带参的显示书籍函数

{

  cout<<” ☆☆☆☆☆☆☆☆☆☆☆书★★籍★★信★★息★★列★★表☆☆☆☆☆☆☆☆☆☆☆nn“;

  cout<<”书号“;

(10);

  cout<<”书名“;

(10);

  cout<<”作者“;

(17);

  cout<<”状态“;

(25);

  cout<<”借阅人n“;

  for(int i=0;i

{ cout<

(10);

  cout<

(10);

  cout<

(20);

  Books[i].show_tag();

(20);

  cout<

}

} void show_book(int i)//带参的显示书籍函数

{ cout<<” ☆☆☆☆☆☆☆☆☆☆☆书★★籍★★信★★息★★列★★表☆☆☆☆☆☆☆☆☆☆☆nn“;

  cout<<”书号“;

(10);

  cout<<”书名“;

(10);

  cout<<”作者“;

(17);

  cout<<”状态“;

(25);

  cout<<”借阅人n“;

  cout<

(10);

  cout<

(10);

  cout<

(20);

  Books[i].show_tag();

(20);

  cout<

}

  void br_book()//读者借、还书功能函数

{

  readerManage reader;

  int choi;//选择

  int a;

//图书状态指标(1已借2在架)

  char sh[10];//需要还书的书号

  char dz[10];//读者姓名

  cin>>sh;

  int index=bnu_search(sh);//定义一个变量等于查找到的书号

  if(index>=0)

{ if(books[index].tag==1)//已借

  A=1;

  if(books[index].tag==0)//在架

  A=2;

  switch(a)

{ case 1:

  cout<<”nt该书目前状态为<已借出>n“;

  cout<<”nt请选择您需要的服务:1:还书

  0:返回n“;

  cin>>choi;

();//清除以回车结束的输入缓冲区的内容,消除上一次输入对下一次输入的影响

  if(choi!=1&&choi!=0)

{

  cout<<”nt操作有误,请重新选择(0/1)!n“;

  return;

}

  else if(choi==1)

{

  cout<<”nt请输入您的姓名:“;

  cin>>dz;

();

  int index1=(dz);

  if(index1==-1)

{

  cout<<”nt对不起,系统无该读者记录,新用户请先注册!“;

  return;

}

  else

{

  strcpy(dz,”“);//将读者姓名已空白代替

  Books[index].set_rname(dz);//借阅人一项变为空白

  Books[index].set_tag(0);//图书状态变为在架

  cout<<”nt还书成功!“<

}

}break;

  case 2:

  cout<<”nt该书目前状态为<在馆>n“;

  cout<<”nt请您需要的服务:1:借书

  0:返回n“;

  cin>>choi;

();

  if(choi!=1&&choi!=0)

{

  cout<<”nt操作有误,请重新选择(0/1)!n“;

  return;

}

  else if(choi==1)

{

  cout<<”nt请输入您的姓名:“;

  cin>>dz;

  int index1=(dz);

  if(index1==-1)

{ cout<<”nt对不起,系统无改读者记录,新用户请先注册!“;

  return;

}

  else

{

  Books[index].set_rname(dz);

  Books[index].set_tag(1);

  cout<<”nt借书成功!“<

}

}break;

}

}

  else

{

  cout<<”nt对不起,系统无该书记录!“;}

}

  Bool in(int i)//判断图书是否在架函数

{

  if(books[i].tag==1)

  return false;

  return true;

}

};//**********菜单结构体,实现界面引导********** class Menu {

  BookManage bm;

//定义书籍管理结构体对象bm ReaderManage rm;

//定义读者管理结构体对象rm Reader r;

//定义读者结构体对象r private: int choice;

//菜单序号选择

  int key;

//管理员密码 public: void header()

//页眉

{

  system(”color fd“);

  cout<<”t

☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆n“;

  cout<<”t

☆n“;

  cout<<”t

☆n“;

  cout<<”t

  图

  书

  借

  阅

  管

  理

  系

  统

☆n“;

  cout<<”t

☆n“;

  cout<<”t

☆n“;

  cout<<”t

☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆n“;} void log_menu()

//主界面登录菜单

{

  system(”color fd“);

  header();

  cout<<”nttt< 请

  选

  择

  登

  录

  身

  份 >n“;

  cout<<”ntttt1: 管理员nntttt2: 读

  者nntttt0: 退

  出nt您的选择是: “;choice: cin>>choice;

();

//清除以回车结束的输入缓冲区的内容,消除上一次输入对下一次输入的影响

  switch(choice)

{

  case 1:

  log_admin();

//管理员登录,需密码验证

  Break;

  case 2:

  reader_lr();

//读者登录或注册

  Break;

  case 0:

  exit(1);

//退出系统

  Break;

  default:

  cout<<”nt您的操作有误,请重新选择(0→2): “;

  goto choice;

} } void admin_menu()

//管理员管理菜单

{

  system(”cls“);

  system(”color f9“);

  cout<<”t

☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆n“;

  cout<<”t

☆n“;

  cout<<”t

  系★统★管★理★界★面

☆n“;

  cout<<”t

☆n“;

  cout<<”t

  1: 添加新的图书资料

  2: 修改已有图书资料

☆n“;

  cout<<”t

☆n“;

  cout<<”t

  3: 删除已有图书资料

  4: 查找已有图书资料

☆n“;

  cout<<”t

☆n“;

  cout<<”t

  5: 查看所有图书资料

  6: 修改读者用户信息

☆n“;

  cout<<”t

☆n“;

  cout<<”t

  7: 删除读者用户信息

  8: 查看所有读者信息

☆n“;

  cout<<”t

☆n“;

  cout<<”t

  9: 返回系统登录界面

  0: 退出图书管理系统

☆n“;

  cout<<”t

☆n“;

  cout<<”t

☆n“;

  cout<<”t

☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆n“;

  cout<<”nt请选择您需要的服务序号: “;choice: cin>>choice;

();

  switch(choice)

{

  case 1:

//添加图书

  AddBook();

  Bm.~BookManage();

  Break;

  case 2:

//修改图书

  reviseBook();

  Bm.~BookManage();

  Break;

  case 3:

//删除图书

  delBook();

  Bm.~BookManage();

  Break;

  case 4:

//查找图书

  Absearch_menu();

  Break;

  case 5:

//查看全部图书

  _book();

  cout<<”nt显示完毕!“;

  system(”pause“);

  Admin_menu();

  Break;

  case 6:

//修改读者

  reviseReader();

  rm.~ReaderManage();

  Break;

  case 7:

//删除读者

  delReader();

  rm.~ReaderManage();

  Break;

  case 8: //查看所有读者

  _reader();

  cout<<”nt显示完毕!“;

  system(”pause“);

  Admin_menu();

  Break;

  case 9: //返回系统登录界面

  system(”cls“);

  log_menu();

  case 0: //退出系统

  exit(1);

  Break;

  default:

  cout<<”nt您的操作有误,请重新选择(0→7): “;

  goto choice;

} } void reader_menu()

//读者服务菜单

{

  system(”cls“);

  system(”color f9“);

  cout<<”t

☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆n“;

  cout<<”t

☆n“;

  cout<<”t

  读★者★服★务★界★面

☆n“;

  cout<<”t

☆n“;

  cout<<”t

  1: 借 阅 图 书

  2: 归 还 图 书

☆n“;

  cout<<”t

☆n“;

  cout<<”t

  3: 查 找 图 书

  4: 借 阅 情 况

☆n“;

  cout<<”t

☆n“;

  cout<<”t

  5: 返 上 一 级

  0: 退 出 系 统

☆n“;

  cout<<”t

☆n“;

  cout<<”t

☆n“;

  cout<<”t

☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆n“;

  cout<<”nt请选择您需要的服务序号: “;choice: cin>>choice;

();

  switch(choice)

{

  case 1:

  cout<<”nt请输入您欲借阅的图书书号: “;

  _book();

  Bm.~BookManage();

  Break;

  case 2:

  cout<<”nt请输入您欲归还的图书书号: “;

  _book();

  Bm.~BookManage();

  Break;

  case 3:

  Bsearch_menu();

  Break;

  case 4:

  rn_search();

  Break;

  case 5:

  system(”cls“);

  reader_lr();

  Break;

  case 0:

  exit(1);

  Break;

  default:

  cout<<”nt您的操作有误,请重新选择(0→5):

  goto choice;

} } void bsearch_menu()

//读者查找书籍菜单

{

  system(“color f2”);

  cout<<“ttt☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆n”;cout<<“ttt☆

☆n”;

  cout<<“ttt☆

  书★籍★查★找★界★面

☆n”;

  cout<<“ttt☆

☆n”;

  cout<<“ttt☆

  1: 按 书号查找

☆n”;

  cout<<“ttt☆

☆n”;

  cout<<“ttt☆

  2: 按 书名查找

☆n”;

  cout<<“ttt☆

☆n”;

  cout<<“ttt☆

  3: 按 作者查找

☆n”;

  cout<<“ttt☆

☆n”;

  cout<<“ttt☆

  4: 返 回 上 级

☆n”;

  cout<<“ttt☆

☆n”;

  cout<<“ttt☆

  0: 退 出 系 统

☆n”;cout<<“ttt☆

☆n”;

  cout<<“ttt☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆n”;

  int bsc;//book search choice cout<<“nt请输入您需要的服务序号: ”;

  cin>>bsc;

();

  switch(bsc){

  case 1:

  Bnu_search();

  Break;

  case 2:

  Bna_search();

“;

  Break;

  case 3:

  Bau_search();

  Break;

  case 4:

  reader_menu();

  Break;

  case 5:

  exit(1);

  default:

  cout<<”nt操作有误,请重新选择<0→4>“;

  Break;

}

}

  void absearch_menu()

//管理员查找书籍菜单

{

  system(”color f2“);

  cout<<”ttt☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆n“;

  cout<<”ttt☆

☆n“;

  cout<<”ttt☆

  书★籍★查★找★界★面

☆n“;

  cout<<”ttt☆

☆n“;

  cout<<”ttt☆

  1: 按 书号查找

☆n“;

  cout<<”ttt☆

☆n“;

  cout<<”ttt☆

  2: 按 书名查找

☆n“;

  cout<<”ttt☆

☆n“;

  cout<<”ttt☆

  3: 按 作者查找

☆n“;

  cout<<”ttt☆

☆n“;

  cout<<”ttt☆

  4: 返 回 上 级

☆n“;

  cout<<”ttt☆

☆n“;

  cout<<”ttt☆

  0: 退 出 系 统

☆n“;

  cout<<”ttt☆

☆n“;

  cout<<”ttt☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆n“;

  int bsc;//book search choice

  cout<<”nt请输入您需要的服务序号: “;

  cin>>bsc;

();

  switch(bsc)

{

  case 1:

  Bnu_search();

  Break;

  case 2:

  Bna_search();

  Break;

  case 3:

  Bau_search();

  Break;

  case 4:

  Admin_menu();

  Break;

  case 5:

  exit(1);

  default:

  cout<<”nt操作有误,请重新选择<0→4>“;

  Break;

}

} void reader_lr()//读者登录或注册菜单 {

  system(”cls“);

  header();

  system(”color f1“);

  cout<<”nttt< 读

  者

  登

  录

  界

  面 >n“;

  cout<<”nttt

  1: 登

  录t2: 注

  册nnttt

  3: 返

  回t0: 退

  出nt您的选择是: “;

  int rlc;//reader login choice choice: cin>>rlc;

();

  switch(rlc)

{

  case 1:

//已注册读者登录

  cout<<”nt请输入您的姓名: “;

  char rn[10];//reader name

  cin>>rn;

  _rname(rn);

  if(_reader(r))

{

  cout<<”nt登录成功!“;

  system(”pause“);

  reader_menu();

}

  else

  cout<<”nt登录失败!新用户请先注册!“;

  system(”pause“);

  reader_lr();

  Break;

  case 2:

//新用户注册

  _reader();

  rm.~ReaderManage();

  system(”pause“);

  reader_lr();

  Break;

  case 3:

  system(”cls“);

  log_menu();

  case 0:

  exit(1);

  Break;

  default:

  cout<<”nt您的操作有误,请重新选择(0→2):

  goto choice;

} } void log_admin()

//管理员登录

{

  cout<<“nt请输入管理员密码:”;

  int key;

  cin>>key;

  if(key==)

{

  cout<<“nt登录成功!nnt”;

  system(“pause”);

  Admin_menu();

//管理员操作菜单

}

  else

{cout<<“nt登录失败!原因是密码错误!n”;

  cout<<“nt请选择 <1:返回上一级菜单

  0:退出系统>

  cin>>choice;

();

  switch(choice)

”;“;

{

  case 1:

  system(”cls“);

  log_menu();

  Break;

  case 0:

  exit(1);

  Break;

  default:

  cout<<”nt操作有误,请重新选择(0/1)“;

}

} } void rn_search()

//按书号查找函数

{

  char rn[10];//reader name

  cout<<”nt请输入您的姓名:“;

  cin>>rn;

  int index=_search(rn);

  if(index>=0)

  _book(index);

  else

  cout<<”nt对不起,系统无您的借阅记录!“;

  cout<<”nt“;

  system(”pause“);

  reader_menu();

} void bnu_search()

//按书号查找函数

{

  char bnu[10];

  cout<<”nt请输入您要查找的书号:“;

  cin>>bnu;

  int index=_search(bnu);

  if(index>=0)

  _book(index);

  else

  cout<<”nt对不起,系统无该书籍记录!“;

  cout<<”nt“;

  system(”pause“);

  Bsearch_menu();

}

  void bna_search()

//按书名查找函数

{

  cout<<”nt请输入您要查找的书名:“<

  char bna[20];

  cin>>bna;

  int index=_search(bna);

  if(index>=0)

  _book(index);

  else

  cout<<”nt对不起,系统无该书籍记录!“;

  cout<<”nt“;

  system(”pause“);

  Bsearch_menu();

}

  void bau_search()

//按作者查找函数

{

  cout<<”nt请输入您要查找的作者:“<

  char bau[10];

  cin>>bau;

  int index=_search(bau);

  if(index>=0)

  _book(index);

  else

  cout<<”nt对不起,系统无该书籍记录!“;

  cout<<”nt“;

  system(”pause“);

  Bsearch_menu();

}

  void addBook()

//新增书籍函数

{ char numb[10];

//书号

  char nameb[20];

//书名

  char authorb[10];//作者

  Book book;

//书籍结构体对象book

  int tag1;input1:cout<<”nt请输入新书书号:“;

  cin>>numb;

  int index=_search(numb);

  if(index==-1)

{

  cout<<”nt系统目前尚无该书记录,您可以继续操作!n“;

  cout<<”nt请输入新书书名:“;

  cin>>nameb;

  cout<<”nt请输入新书作者:“;

  cin>>authorb;

  tag1=0;

  _bnum(numb);

  _bname(nameb);

  _bauthor(authorb);

  _tag(tag1);

(book);

  cout<<”nt恭喜您!新书资料录入成功!“;

}

  else

{

  cout<<”nt对不起,该书号纪录已存在!请重新输入!“;

  goto input1;

}

  system(”pause“);

  Admin_menu();} void reviseBook()

//修改书籍函数

{

  char numb[10];

  char nameb[20];

  char authorb[10];

  Book book;

  int index=-1;input2: cout<<”nt请输入您要修改书籍的书号:“;

  cin>>numb;

  index=_search(numb);

  if(index==-1)

{

  cout<<”nt对不起,您输入的书号不存在,请重新输入!“<

  goto input2;

  return;

}

  Bool sta=(index);//判断是否在馆

  if(sta)

{ cout<<”nt该书目前处于<在架>状态,您可以继续操作!“;

  cout<<”nt请输入更改后的书名:“;

  cin>>nameb;

  cout<<”nt请输入更改后的作者:“;

  cin>>authorb;

  _bnum(numb);

  _bname(nameb);

  _bauthor(authorb);

(book,index);

  cout<<”nt恭喜您!书籍资料修改成功!“;}

  else

  cout<<”nt该书已被借出,请于读者归还后再进行相关操作!“<

  system(”pause“);

  Admin_menu();

} void delBook()

//删除书籍函数

{

  char numb[10];

  cout<<”nt请输入您要删除书籍的书号:“;

  cin>>numb;

  int index=_search(numb);

  if(index>=0)

{

  cout<<”nt您确定要删除该书记录吗(y/n)

“;

  char y;

  cin>>y;

  if(y=='y'||y=='Y')

{

(index);

  cout<<”nt删除成功!“;

}

  else

  cout<<”nt删除取消!“;

}

  else

  cout<<”nt对不起,系统没有该图书记录!“;

  system(”pause“);

  Admin_menu();

} void reviseReader()//修改读者用户函数

{

  char namer[10];

  reader reader;get1:

  cout<<”nt请输入你要修改读者用户的姓名: “;

  cin>>namer;

  int index=(namer);

  if(index==-1)

{

  cout<<”nt对不起,系统无改读者记录,重新输入请按1,返回请按0:

  int a;

  cin>>a;get2:

();

  switch(a)

{

  case 1:

  goto get1;

  Break;

  case 0:

  system(“pause”);

  Admin_menu();

  Break;

  default:

  cout<<“nt您的操作有误,请重新选择(0/1):

”;

  goto get2;

}

  return;

}

“;

  else

{

  char namer[10];

  char classr[10];

  char telr[10];

  reader reader;

  cout<<”nt请输入更改后的读者姓名:“;

  cin>>namer;

  cout<<”nt请输入更改后的班级名称:“;

  cin>>classr;

  cout<<”nt请输入更改后的联系电话:“;

  cin>>telr;

  _rname(namer);

  _rclass(classr);

  _rtel(telr);

  cout<<”nt是否真的修改该记录(y/n?):“;

  char y;

  cin>>y;

  if(y=='y'||y=='Y')

{ (reader,index);

  cout<<”nt修改成功!n“;

}

  else

  cout<<”nt操作取消!n“;

}

  system(”pause“);

  Admin_menu();

}

  void delReader()

//删除读者用户函数

{

  cout<<”nt请输入您要删除的读者用户的姓名:“<

  char namer[10];

  cin>>namer;

  int index=(namer);

  if(index>=0)

{

  cout<<”nt是否真的删除该记录(y/n?): “;

  char y;

  cin>>y;

  if(y=='y'||y=='Y')

{

  _reader(index);

  cout<<”nt删除成功!n“;

}

  else

  cout<<”nt操作取消!n“;

}

  else

  cout<<”nt对不起,系统尚无该读者记录!“;

  system(”pause“);

  Admin_menu();

} };//********主函数******** int main(){

  system(”color fd“);Menu menu;//定义菜单结构体对象menu

  cout<<”ttt 文计091-1 庞丽萍

“;cout<<”ttt

  当前日期:2011-6-22 星期三“;cout<<”ttt

  当前时间:08:00

“;cout<<”nttt

★ 欢 “;cout<<”★ 迎 “;

} cout<<”★ 进 “;cout<<”★ 入 ★nn";_menu();return 0;四.程序正确性验证

  1主页面

  2.管理员登陆页面

  3.图书添加

  五.课程设计过程中出现的问题、原因及解决方法

  1.用户登录密码时,不能使用暗码来保护密码。(未解决成功)2.每个界面都能退出到主页面,而不是直接跳出系统。(以解决)3.书名字长太多影响书籍、作者、数量等之间的一一对应关系。(为解决成功)

  六.课程设计的主要收获

  通过这几天学习设计图书信息管理系统,认识到一切看似简单的事情只有自己动手做,明白了其中的原理才会更好的把它变成自己的东西。图书管理系统主要用到了文件的输入输出,以及利用简单的顺序查找知识,加深了对数据结构的理解与应用。对于这次的课程设计,首先,许多知识不仅仅只是课本上的,需要我们自己去图书馆或网上收集资料。其次,编程过程终遇到各种错误,需要我们耐心分析,讨论,最后得出正确结果。第三,程序无错,进行调试,然后进行加工修改优化。

  七.对今后课程设计的建议

  希望老师可以分小组做课程设计,题目可以相应的增大难度。分组可以锻炼团对合作能力,队员可以相互讨论解决问题,彼此能够激发更多的思想,做出更完善的作品,同时也防止了互相拷贝的情况,让每个同学都积极的参与到设计中,而不是坐享其成。

数据结构课程设计—西文图书管理系统3

  数据结构大作业 伍杨

  数据结构大作业 图书管理系统

  工程管理 伍杨

  目录一、二、三、题目要求...................................................................2 总体设计...................................................................2 编码实现...................................................................3 1)定义图书结构体.......................................................3 2)登记操作...............................................................4 3)查看操作...............................................................8 4)删除操作.............................................................11 5)Main函数...........................................................20四、五、六、调试与测试..............................................................26 五心得体会..............................................................28 用户手册.................................................................28

  数据结构大作业 伍杨

  一、题目要求

  1)目的要求

  本课程设计任务的目的是要求学生按照分析、设计、编码、调试和测试的软件开发过程独立完成管理系统设计,以及C语言算法的掌握,并能最终实现本系统的功能要求,通过这个程序可以学习到以前调试短程序没有的的经验。2)题目要求

  实现图书管理信息系统的设计。要求实现图书添加、显示全部图书、查询、借阅和归还。主要考查利用文件的操作!

  二、总体设计

  数据结构大作业 伍杨

  三、编码实现

  1)定义图书结构体

  struct book{

  char bookname[20];

//书名

  int NO;

//书编号

  char type[20];

//类型

  int date;

//到书日期 };struct person{

  char name[10];

//姓名

  char classes[20];

//班级

  int number;

//学号

  char telephone[12];

//联系电话

  int NO;

//书编号

  char bookname[20];

//书名

  int borrowdate;

//借书日期

  int returndate;

//还书日期

  数据结构大作业 伍杨

  2)登记操作

  void new_book(){ FILE *fp;struct book b;//登记新书

  int i,j;

  printf(“请朱老师输入此次收到的书本总数:”);if((fp=fopen(“”,“a”))==NULL){ printf(“File open error!n”);exit(0);}

  scanf(“%d”,&i);

  for(j=0;j

  printf(“请朱老师输入书名:”);scanf(“%s”,);fprintf(fp,“%s”,);printf(“请朱老师输入书编号:”);scanf(“%d”,&);fprintf(fp,“

%d”,);printf(“请朱老师输入类型:”);scanf(“%s”,);

  数据结构大作业 伍杨

}

} fprintf(fp,“

%s”,);printf(“请朱老师输入到书日期:”);scanf(“%d”,&);fprintf(fp,“

%d”,);if(fclose(fp)){

} printf(“Can not close the file!n”);exit(0);void new_person()

{

  fILE *fp;struct person p;char choice;

//登记借书

  if((fp=fopen(“”,“a”))==NULL){ printf(“File open error!n”);exit(0);}

  数据结构大作业 伍杨

  printf(“请朱老师输入借书人姓名:”);scanf(“%s”,);fprintf(fp,“%s”,);printf(“请朱老师输入借书人班级:”);scanf(“%s”,);fprintf(fp,“

%s”,);printf(“请朱老师输入借书人学号:”);scanf(“%d”,&);fprintf(fp,“

%d”,);printf(“请朱老师输入借书人联系电话:”);scanf(“%s”,);fprintf(fp,“

%s”,);printf(“请朱老师输入书编号:”);scanf(“%d”,&);fprintf(fp,“

%d”,);printf(“请朱老师输入书名:”);scanf(“%s”,);fprintf(fp,“

%s”,);printf(“请朱老师输入借书日期:”);scanf(“%d”,&);fprintf(fp,“

%d”,);

  数据结构大作业 伍杨

  printf(“请朱老师输入还书日期:”);scanf(“%d”,&);fprintf(fp,“

%d”,);printf(“nt您想继续吗?(y/n)”);scanf(“ %c”,&choice);if(choice=='Y'||choice=='y'){

} system(“cls”);new_person();if(fclose(fp)){

} printf(“Can not close the file!n”);exit(0);}实现程序对文件的读取 void Read(){

  int i=0;int j=0;ifstream in(“”,ios::out);in>>i;

  数据结构大作业 伍杨

  nt;

} all=i;if(i>0&&i<=Max){

  in>>data[j].id>>data[j].name>>data[j].type>>data[j].status>>data[j].coufor(j=1;j<=i;j++){ } } ();

  3)查看操作

  v void see_book(){

  fILE *fp;long NO;char bookname[20];char type[20];long date;//查看书库记录

  数据结构大作业 伍杨

} if((fp=fopen(“”,“r”))==NULL){

} printf(“File open error!n”);exit(0);while(!feof(fp)){ fscanf(fp,“%s%ld%s%ld”,bookname,&NO,type,&date);printf(“%-10s %-10ld %-10s %ldn”,bookname,NO,type,date);};if(fclose(fp)){

} printf(“Can not close the file!n”);exit(0);void see_person(){ //查看所有借书记录

  数据结构大作业 伍杨

  fILE *fp;char name[10];

  char classes[20];

  int number;char telephone[20];

  int NO;

  char bookname[20];

  int borrowdate;

  int returndate;

  fscanf(fp,“%s %s %ld %s %ld %s %ld %ld”,name,classes,&number,telephonwhile(!feof(fp)){ if((fp=fopen(“”,“r”))==NULL){

} printf(“File open error!n”);exit(0);e,&NO,bookname,&borrowdate,&returndate);printf(“%-5s %-5s %ld %-5s %ld %-5s %ld %ldn”,name,classes,number,telephone,NO,bookname,borrowdate,returndate);

  数据结构大作业 伍杨

} };if(fclose(fp)){

} printf(“Can not close the file!n”);exit(0);

  4)删除操作

  void delete_books()

{

  int number;void deletebooks();

  printf(“请输入您要删除的书编号:”);scanf(“%d”,&number);FILE *fp;struct book b;

//删除旧书

  数据结构大作业 伍杨

  if((fp=fopen(“”,“r”))==NULL){

} printf(“不能打开此文件!n”);exit(0);while(!feof(fp)){ fscanf(fp,“%s %d %s %d”,,&,,&);

} if(==number){

} printf(“nnt***************图书信息*******************n”);printf(“nt图书书名:%25s”,);printf(“nt----------”);printf(“nt图书编号:%25d”,);printf(“nt----------”);printf(“nt图书类型:%23s”,);printf(“nt----------”);printf(“nt到书日期:%25d”,);printf(“nt----------”);

  deletebooks();

  数据结构大作业 伍杨

}

  void deletebooks(){

  While(!feof(fp)){ fscanf(fp,“%s %d %s %d”,,&,,&);if((fp=fopen(“”,“r”))==NULL){

} if((fp1=fopen(“”,“w”))==NULL){

//建立一个临时文件

} printf(“不能打开此文件!n”);exit(0);printf(“不能打开此文件!n”);exit(0);printf(“nn确认删除?请再次输入书编号:”);scanf(“%d”,&number);FILE *fp,*fp1,*fp2,*fp3;int number;struct book b;

  数据结构大作业 伍杨

} if(==number)continue;else

  fprintf(fp1,“%s %d %s %d”,,,,);fclose(fp);fclose(fp1);if((fp2=fopen(“”,“r”))==NULL){

} if((fp3=fopen(“”,“w”))==NULL){

//清空书库

} while(!feof(fp2)){

//将临时文件的内容写人源文件

} fscanf(fp2,“%s %d %s %d”,,&,,&);fprintf(fp3,“%s %d %s %d”,,,,);printf(“不能打开此文件!n”);exit(0);printf(“不能打开此文件!n”);exit(0);

  数据结构大作业 伍杨

}

  void delete_returnbook(){

  if((fp=fopen(“”,“r”))==NULL){

} printf(“不能打开此文件!n”);exit(0);printf(“n请输入所还书本的书编号:”);scanf(“%d”,&numbers);FILE *fp;int numbers;struct person p;void deletereturnbook();char choice;printf(“n

  删除成功!n”);fclose(fp2);fclose(fp3);

//删除借书记录

  数据结构大作业 伍杨

  While(!feof(fp)){

  fscanf(fp,“%s %s %ld %s %ld %s %ld %ld”,,,&,,&,,&,&);

  if(==numbers){

  printf(“nt***************图书信息*******************n”);printf(“nt借书人姓名:%20s”,);printf(“nt----------”);printf(“nt借书人班级:%20s”,);printf(“nt----------”);printf(“nt借书人学号:%20d”,);printf(“nt----------”);printf(“nt借书人联系电话:%20s”,);printf(“nt----------”);printf(“nt图书编号:%24d”,);printf(“nt----------”);printf(“nt图书名称:%23s”,);printf(“nt----------”);printf(“nt借书日期:%25d”,);printf(“nt----------”);printf(“nt还书日期:%25d”,);

  数据结构大作业 伍杨

}

}

} printf(“nt----------”);

  deletereturnbook();

  printf(“nt您想继续吗?(y/n)”);scanf(“ %c”,&choice);if(choice=='Y'||choice=='y'){

} system(“cls”);delete_returnbook();fclose(fp);void deletereturnbook(){ FILE *fp,*fp1,*fp2,*fp3;struct person p;

  int numbers;printf(“nn确认删除?请再次输入书编号:”);

  数据结构大作业 伍杨

  scanf(“%d”,&numbers);if((fp=fopen(“”,“r”))==NULL){

} if((fp1=fopen(“”,“w”))==NULL){

} printf(“不能打开此文件!n”);exit(0);printf(“不能打开此文件!n”);exit(0);while(!feof(fp)){ fscanf(fp,“%s %s %d %s %d %s %d %d”,,,&,,&,,&,&);

  if(==numbers)continue;else

  fprintf(fp1,“%s %s %d %s %d %s %d %d”,,,,,,,

  数据结构大作业 伍杨

  e,);

  fscanf(fp2,“%s %s %d %s %d %s %d %d”,,,while(!feof(fp2)){

//将临时文件写人源文件 if((fp2=fopen(“”,“r”))==NULL){

} if((fp3=fopen(“”,“w”))==NULL){

} printf(“不能打开此文件!n”);exit(0);printf(“不能打开此文件!n”);exit(0);fclose(fp);fclose(fp1);} &,,&,,&,&);

  fprintf(fp3,“%s %s %d %s %d %s %d %d”,,p.数据结构大作业 伍杨

  classes,,,,,,);

} printf(“n

  删除成功!n”);fclose(fp2);fclose(fp3);} 5)Main函数

  int main(void){

  do{ printf(“nnn

  图书馆管理系统na”);printf(“ *******************************************************n”);int choice;char choice2;struct book;struct person;

  数据结构大作业 伍杨

  printf(“ ***朱老师您好吖********功能选项: 登记******请按1,******n”);printf(“ ******************************* 查看/查询*请按2 ******n”);printf(“ ******************************* 删除***** 请按3 ******n”);printf(“ ******************************* 退出***** 请按0 ******n”);printf(“ *******************************************************nnn”);printf(“

  请选择功能:”);scanf(“%d”,&choice);switch(choice){ case 1:

  printf(“

  登记选项:新书登记请按1,借书登记请按2,返回请按3n”);printf(“请选择:”);scanf(“%d”,&choice);switch(choice){ case 1:

  system(“cls”);

//清屏 printf(“新书资料登记:nn”);new_book();

//新书登记 printf(“登记完毕!n”);printf(“n”);scanf(“ %c”,&choice2);system(“cls”);break;

  数据结构大作业 伍杨

  case 2:

  system(“cls”);printf(“借书资料登记:nn”);new_person();

//借书登记 printf(“n press anykey ”);scanf(“ %c”,&choice2);system(“cls”);break;case 3:

} break;system(“cls”);break;

  case 2: printf(“

  查看/查询选项:书库查看请按1,总借书记录查看请按2,到期记录查询请按3,返回请按4n”);

  printf(“请选择:”);scanf(“%d”,&choice);switch(choice){ case 1:

  system(“cls”);printf(“欢迎朱老师进入书库!nn”);

  数据结构大作业 伍杨

  printf(“书名

  书编号

  类型

  到书日期n”);printf(“-----------n”);see_book();

//书库显示 printf(“n press anykey ”);scanf(“ %c”,&choice2);system(“cls”);break;case 2:

  system(“cls”);printf(“欢迎朱老师进入借书记录!nn”);printf(“姓名

  班级 学号 联系电话 书编号 书名

  借书日期 到书日期n”);

  printf(“-------------------------n”);see_person();

//借书记录显示

  printf(“n press anykey ”);scanf(“ %c”,&choice2);system(“cls”);break;case 3:

  system(“cls”);search_person();

//显示符合记录 printf(“n press anykey ”);

  数据结构大作业 伍杨

  scanf(“ %c”,&choice2);system(“cls”);break;case 4:

} break;system(“cls”);break;case 3: printf(“

  删除选项:旧书删除请按1,借书记录删除请按2,返回请按3n”);

  printf(“请选择:”);scanf(“%d”,&choice);switch(choice){ case 1:

  system(“cls”);delete_books();

//删除ing printf(“n press anykey ”);scanf(“ %c”,&choice2);system(“cls”);break;case 2:

  数据结构大作业 伍杨

}

  system(“cls”);delete_returnbook();

//删除ing printf(“n press anykey ”);scanf(“ %c”,&choice2);system(“cls”);break;case 3:

} break;system(“cls”);break;case 0:

} system(“cls”);}while(choice!= 0);return 0;

  数据结构大作业 伍杨

  四、调试与测试

  主菜单

  登记

  数据结构大作业 伍杨

  查看

  删除

  生成的文件内信息

  数据结构大作业 伍杨五、五心得体会

  经过这次大作业,我觉得代码的编写,最主要的的是编程思想,语言其实不是太重要,思路最重要!

  六、用户手册

  程序执行文件为 lib ,打开执行文件后按提示操作即可