资源简介

北邮大二下学期数据结构课程设计题目-图书馆管理系统,压缩包包含源代码和工程文件,实现了题目要求的增删改查,数据统计,欠费处理,文件存取等功能。

资源截图

代码片段和文件信息

/*此cpp主要包含对图书的操作*/

#include
#include
#include“Library.h“

using namespace std;

void Book_operate()         //图书信息管理操作 
{
    char i;

do{
       cout<<“  ┌──────────────────────┐\n“;
       cout<<“  │---------------图书信息管理-----------------│\n“;
   cout<<“  │服务项目:                                   │\n“;
       cout<<“  │        1  增加                             │\n“;
       cout<<“  │        2  删除                             │\n“;
   cout<<“  │        3  显示                             │\n“;
   cout<<“  │        4  修改                             │\n“;
   cout<<“  │        0  返回                             │\n“;
   cout<<“  └──────────────────────┘\n“;
       
       cout<<“请选择服务项目:“;
   cin>>i;

   switch(i){
          case‘1‘:
 add_book();
 break;
  case‘2‘:
 del_book();
 break;
  case‘3‘:
 print_all();
     break;
          case‘4‘:
 Book_modify();
     break;
  case‘0‘:
     break;
          default:
 cout<<“输入无效“<  Book_operate();
 break;
        }
       }while(i!=‘0‘);
    return;
    }

void add_book()       //增加图书 
{
Bcurrentptr=new Book;
if(Bheadptr==NULL){
Bheadptr=Bcurrentptr;
Blastptr=Bcurrentptr;
}
if(Bcurrentptr!=NULL){
cout<<“请输入书籍信息:“< cout<<“ISBN:“;
cin>>Bcurrentptr->ISBN;
cout<<“名称:“;
do gets(Bcurrentptr->Bname); while(!Bcurrentptr->Bname[0]);
cout<<“作者:“;
do gets(Bcurrentptr->Author); while(!Bcurrentptr->Author[0]);
cout<<“出版社:“;
cin>>Bcurrentptr->Press;
cout<<“类型:“;
cin>>Bcurrentptr->Type;
cout<<“简介:“;
do gets(Bcurrentptr->Intro); while(!Bcurrentptr->Intro[0]);
cout<<“数量:“;
cin>>Bcurrentptr->Num;
        
        Bcurrentptr->Date=day;
Bcurrentptr->Remain=Bcurrentptr->Num;

Bcurrentptr->Code[0]=Bcurrentptr->Type[0];
Bcurrentptr->Code[1]=Bcurrentptr->Type[1];
Bcurrentptr->Code[2]=Bcurrentptr->Press[0];
Bcurrentptr->Code[3]=Bcurrentptr->Press[1];
Bcurrentptr->Code[4]=sptr[0];
Bcurrentptr->Code[5]=sptr[1];
Bcurrentptr->Code[6]=sptr[2];
Bcurrentptr->Code[7]=sptr[3];
Bcurrentptr->Code[8]=sptr[4];
Bcurrentptr->Code[9]=‘\0‘;
serial();
for(int i=0;i<10;i++)
Bcurrentptr->reader[i]=NULL;

Blastptr->nextptr=Bcurrentptr;
Blastptr=Bcurrentptr;
Blastptr->nextptr=NULL;

cout<<“添加成功“< }
else
cout<<“添加失败“< Save_book();
}

void Book_modify()            //修改图书 
{
int n;

printf(“\n请选择输入图书的方式:\n\t1-名称\n\t2-ISBN\n\t3-内部编号\n“);
search_book(‘0‘);
if(Bcurrentptr==NULL)
return;
cout<<“请输入增加本数:“;
cin>>n;
Bcurrentptr->Num+=n;
Bcurrentptr->Remain+=n;
Save_book();

}
void del_book()            //删除图书 
{
    search_book(‘3‘);
    
    if(Bcurrentptr!=NULL)
{
       if(Bcurrentptr->Num!=Bcurrentptr->Remain)
       {
           printf(“此书有人借,无法删除!\n“);
           return;
           }
       if(Bcurrentptr==Bheadptr)
           Bheadptr=Bcurrentptr->nex

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       6330  2013-06-05 18:09  Library\Book.cpp

     文件       3335  2013-06-05 18:09  Library\File.cpp

     文件        118  2013-11-25 11:35  Library\Library\Library\Book.txt

     文件     193578  2013-11-25 11:34  Library\Library\Library\Debug\Book.obj

     文件       6736  2013-11-25 11:34  Library\Library\Library\Debug\cl.command.1.tlog

     文件     106000  2013-11-25 11:34  Library\Library\Library\Debug\CL.read.1.tlog

     文件       6138  2013-11-25 11:34  Library\Library\Library\Debug\CL.write.1.tlog

     文件     292560  2013-11-25 11:34  Library\Library\Library\Debug\File.obj

     文件         60  2013-11-25 11:34  Library\Library\Library\Debug\Library.lastbuildstate

     文件       4408  2013-11-25 11:34  Library\Library\Library\Debug\Library.log

     文件     184498  2013-11-25 11:34  Library\Library\Library\Debug\Library.obj

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link-cvtres.read.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link-cvtres.write.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link-rc.read.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link-rc.write.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.1076-cvtres.read.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.1076-cvtres.write.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.1076-rc.read.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.1076-rc.write.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.1076.read.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.1076.write.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.3660-cvtres.read.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.3660-cvtres.write.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.3660-rc.read.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.3660-rc.write.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.3660.read.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.3660.write.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.3704-cvtres.read.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.3704-cvtres.write.1.tlog

     文件          2  2013-11-25 11:34  Library\Library\Library\Debug\link.3704-rc.read.1.tlog

............此处省略72个文件信息

评论

共有 条评论