中易网

图书馆管理系统的中的实体类有哪些?

答案:4  悬赏:40  
解决时间 2021-04-06 23:17
图书馆管理系统的中的实体类有哪些?
最佳答案
最主要的就是图书和读者,一般还有管理员,其他的都不是主要的,要不要都行。
全部回答
#include #include #include #include struct books_list { char author[20]; char bookname[20]; char publisher[20]; char pbtime[15]; char loginnum[10]; float price; char classfy[10]; struct books_list * next; }; struct books_list * create_books_doc(); void insertdoc(struct books_list * head); void deletedoc(struct books_list * head , int num); void print_book_doc(struct books_list * head); void search_book(struct books_list * head); void info_change(struct books_list * head); void save(struct books_list * head); struct books_list * create_books_doc() { struct books_list * head; head=(struct books_list *)malloc(sizeof(struct books_list)); head->next=null; return head; } void save(struct books_list * head) { struct books_list *p; file *fp; p=head; fp=fopen("data.txt","w+"); fprintf(fp,"┏━━━┳━━━━━┳━━━━━┳━━━━━┳━━━━━━┳━━━┳━━━━┓\n"); fprintf(fp,"┃登录号┃ 书 名 ┃ 作 者┃ 出版单位 ┃ 出版时间 ┃分类号┃ 价格 ┃\n"); fprintf(fp,"┣━━━╋━━━━━╋━━━━━╋━━━━━╋━━━━━━╋━━━╋━━━━┫\n"); while(p->next!= null) { p=p->next; fprintf(fp,"┃%-6.6s┃%-10.10s┃%-10.10s┃%-10.10s┃%-12.12s┃%-6.6s┃%.2f ┃\n",p->loginnum,p->bookname,p->author,p->publisher,p->pbtime,p->classfy,p->price); } fprintf(fp,"┗━━━┻━━━━━┻━━━━━┻━━━━━┻━━━━━━┻━━━┻━━━━┛\n"); fclose(fp); printf(" 已将图书数据保存到 data.txt 文件\n"); } void insertdoc(struct books_list *head) { struct books_list *s, *p; char flag='y'; p=head; while(p->next!= null) { p=p->next; } while(flag=='y'||flag=='y') { s=(struct books_list *)malloc(sizeof(struct books_list)); printf("\n 请输入图书登陆号:"); fflush(stdin); scanf("%s",s->loginnum); printf("\n 请输入图书书名:"); fflush(stdin); scanf("%s",s->bookname); printf("\n 请输入图书作者名:"); fflush(stdin); scanf("%s",s->author); printf("\n 请输入图书出版社:"); fflush(stdin); scanf("%s",s->publisher); printf("\n 请输入图书出版时间:"); fflush(stdin); scanf("%s",s->pbtime); printf("\n 请输入图书分类号:"); fflush(stdin); scanf("%s",s->classfy); printf("\n 请输入图书价格:"); fflush(stdin); scanf("%f",&s->price); printf("\n"); p->next=s; p=s; s->next=null; printf(" ━━━━ 添加成功!━━━━"); printf("\n 继续添加?(y/n):"); fflush(stdin); scanf("%c",&flag); printf("\n"); if(flag=='n'||flag=='n') {break;} else if(flag=='y'||flag=='y') {continue;} } save(head); return; } void search_book(struct books_list *head) { struct books_list * p; char temp[20]; p=head; if(head==null || head->next==null) { printf(" ━━━━ 图书库为空!━━━━\n"); } else { printf("请输入您要查找的书名: "); fflush(stdin); scanf("%s",temp); while(p->next!= null) { p=p->next; if(strcmp(p->bookname,temp)==0) { printf("\n图书已找到!\n"); printf("\n"); printf("登录号: %s\t\n",p->loginnum); printf("书名: %s\t\n",p->bookname); printf("作者名: %s\t\n",p->author); printf("出版单位: %s\t\n",p->publisher); printf("出版时间: %s\t\n",p->pbtime); printf("分类号: %s\t\n",p->classfy); printf("价格: %.2f\t\n",p->price); } if(p->next==null) { printf("\n查询完毕!\n"); } } } return; } void print_book_doc(struct books_list * head) { struct books_list * p; if(head==null || head->next==null) { printf("\n ━━━━ 没有图书记录! ━━━━\n\n"); return; } p=head; printf("┏━━━┳━━━━━┳━━━━━┳━━━━━┳━━━━━━┳━━━┳━━━━┓\n"); printf("┃登录号┃ 书 名 ┃ 作 者┃ 出版单位 ┃ 出版时间 ┃分类号┃ 价格 ┃\n"); printf("┣━━━╋━━━━━╋━━━━━╋━━━━━╋━━━━━━╋━━━╋━━━━┫\n"); while(p->next!= null) { p=p->next; printf("┃%-6.6s┃%-10.10s┃%-10.10s┃%-10.10s┃%-12.12s┃%-6.6s┃%.2f ┃\n",p->loginnum,p->bookname,p->author,p->publisher,p->pbtime,p->classfy,p->price); } printf("┗━━━┻━━━━━┻━━━━━┻━━━━━┻━━━━━━┻━━━┻━━━━┛\n"); printf("\n"); } void info_change(struct books_list * head) { struct books_list * p; int panduan=0; char temp[20]; p=head; printf("请输入要修改的书名:"); scanf("%s",temp); while(p->next!= null) { p=p->next; if(strcmp(p->bookname,temp)==0) { printf("\n 请输入图书登陆卡号:"); fflush(stdin); scanf("%s",p->loginnum); printf("\n 请输入图书书名:"); fflush(stdin); scanf("%s",p->bookname); printf("\n 请输入图书作者名:"); fflush(stdin); scanf("%s",p->author); printf("\n 请输入图书出版社:"); fflush(stdin); scanf("%s",p->publisher); printf("\n 请输入图书出版时间:"); fflush(stdin); scanf("%s",p->pbtime); printf("\n 请输入图书分类号:"); fflush(stdin); scanf("%s",p->classfy); printf("\n 请输入图书价格:"); fflush(stdin); scanf("%f",&p->price); printf("\n"); panduan=1; } } if(panduan==0) { printf("\n ━━━━ 没有图书记录! ━━━━\n\n"); } return; } void deletedoc(struct books_list * head) { struct books_list *s,*p; char temp[20]; int panduan; panduan=0; p=s=head; printf(" [请输入您要删除的书名]:"); scanf("%s",temp); while(p!= null) { if(strcmp(p->bookname,temp)==0) { panduan++; break; } p=p->next; } if(panduan==1) { for(;s->next!=p;) { s=s->next; } s->next=p->next; free(p); printf("\n ━━━━ 删除成功! ━━━━\n"); } else { printf(" 您输入的书目不存在,请确认后输入!\n"); } return; } int main(void) { struct books_list * head; char choice; head=null; for(;;) { printf(" ┏━┓━━━━━━━━━━━━━━━━━━━┏━┓\n"); printf(" ┃ ┃ socat 图书管理系统 ┃ ┃\n"); printf(" ┃ ┗━━━━━━━━━━━━━━━━━━━┛ ┃\n"); printf(" ┃ ●[1]图书信息录入 ┃\n"); printf(" ┃ ┃\n"); printf(" ┃ ●[2]图书信息浏览 ┃\n"); printf(" ┃ ┃\n"); printf(" ┃ ●[3]图书信息查询 ┃\n"); printf(" ┃ ┃\n"); printf(" ┃ ●[4]图书信息修改 ┃\n"); printf(" ┃ ┃\n"); printf(" ┃ ●[5]图书信息删除 ┃\n"); printf(" ┃ ┃\n"); printf(" ┃ ●[6]退出系统 ┃\n"); printf(" ┗━━━━━━━━━━━━━━━━━━━━━━━┛\n"); printf(" 请选择:"); fflush(stdin); scanf("%c",&choice); if(choice=='1') { if(head==null) { head=create_books_doc(); } insertdoc(head); } else if(choice=='2') { print_book_doc(head); } else if(choice=='3') { search_book(head); } else if(choice=='4') { info_change(head); } else if(choice=='5') { deletedoc(head); } else if(choice=='6') { printf("\n"); printf(" ━━━━━━━━ 感谢使用图书管理系统 ━━━━━━━━\n"); break; } else { printf(" ━━━━ 输入错误,请重新输入!━━━━"); break; } } return 0; }
这个有点大,员工,图书你怎么设计存储,图书借阅,归还等都要建表地
你这个问题问的大了。。。。基本上是以个表一个实体类。。。。。看你设计的有多少个表
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
荣耀8能不能刷miui
哪里有买刑侦方面的书籍?
修改浏览器时:提示:需要提供管理员权限来更
房建一个平方的抗裂砂浆用量
甲乙两个数,如果甲数加上32就等于乙数,如果
哪里可以无息贷款
崂山啤酒青岛啤酒股份有限公司我想知道这个在
童年 鸣蝉 回忆中本文作者的回忆中童年的印迹
星巴克星享卡用的时候要密码吗?
三奇品牌的泳衣怎么样?
电视机接收的电磁波能转化为数字信号吗
与男孩沟通技巧
大唐村老年协会在哪里啊,我有事要去这个地方
合正DA屏导航怎么样升级导航
兵役登记出现错误:错误代码zb_1303:身份证也
推荐资讯
`` 要怎么样才能使一个群,潜水的人都出来冒
圆明园里有什么东西,在那个地方。
赤壁戟祖籍是哪个?
怎么查股权登记日记
2016款雷克萨斯es250特别限量版与2015款雷克
我qq密保手机换了,不知道怎么申诉?求解!
王伟祯子家常菜(盛业百货商场西北)这个地址在
有谁知道龙之谷噩梦关卡Ⅲ活动的入场方式?
珠海鑫润达怎么样
高学历博士学位,但是很传统,不接受婚前性行
手机信息怎么显示繁体中文
今年资阳市安岳中学的录取线是多少
手机登qq时,显示手机磁盘不足,清理后重新登
刺客的套装怎么选啊?