大一C语言课程设计图书信息管理系统文档格式.docx

上传人:b****3 文档编号:14376794 上传时间:2022-10-22 格式:DOCX 页数:19 大小:68.24KB
下载 相关 举报
大一C语言课程设计图书信息管理系统文档格式.docx_第1页
第1页 / 共19页
大一C语言课程设计图书信息管理系统文档格式.docx_第2页
第2页 / 共19页
大一C语言课程设计图书信息管理系统文档格式.docx_第3页
第3页 / 共19页
大一C语言课程设计图书信息管理系统文档格式.docx_第4页
第4页 / 共19页
大一C语言课程设计图书信息管理系统文档格式.docx_第5页
第5页 / 共19页
点击查看更多>>
下载资源
资源描述

大一C语言课程设计图书信息管理系统文档格式.docx

《大一C语言课程设计图书信息管理系统文档格式.docx》由会员分享,可在线阅读,更多相关《大一C语言课程设计图书信息管理系统文档格式.docx(19页珍藏版)》请在冰豆网上搜索。

大一C语言课程设计图书信息管理系统文档格式.docx

图书信息录入功能(图书信息用文件保存)--输入

图书信息浏览功能--输出

查询和排序功能:

(至少一种查询方式)--算法

按书名查询

按作者名查询

图书信息的删除与修改(可选项)

(2).系统功能与分析(填写你所设计的菜单及流程图)

截图略

返回主菜单

退出

显示图书记录

流程图:

浏览模块流程图

按书名查找模块流程图

按作者查找模块流程图

插入模块流程图

(3)数据结构

typedefstructbook

{

intsort;

charbook_name[15];

charauthor_name[15];

intvert_number;

charpublish_unit[15];

charpublish_time[10];

intprice;

}B

(4).模块设计

根据功能需要:

源文件

函数名

功能

save()

保存

input()

输入

get()

获取

output()

输出

book_name

通过书名查找

author_name()

通过作者查找

modify()

修改

delet()

删除

(5)总体设计思想:

(6)调试过程:

测试数据及结果,出现了哪些问题

(7)程序有待改进的地方及本次实习的收获和建议

……

(8)源程序清单(主要代码)

#include<

stdio.h>

stdlib.h>

string.h>

#defineLENsizeof(structbook)

}B;

B*P,*p1,boo;

intnum=0,f=0;

intsave();

voidinput();

intget();

voidoutput();

voidbook_name();

voidauthor_name();

voidmodify();

voiddelet();

intmain()

intre=1,t,j=0;

intn,choice;

while(re==1)

{

t=1;

system("

cls"

);

printf("

*****************************\n"

printf("

主菜单\n\n"

1.录入信息\n"

2.查看信息\n"

3.查询信息\n"

4.删除与修改信息\n"

5.退出\n"

*****************************"

\n"

if(j==1)printf("

\n\t选择错误!

"

\n\t请选择1-5:

_\b\b"

scanf("

%d"

&

choice);

switch(choice)

{

case1:

{

printf("

\n\t1:

录入信息\n"

input();

\n\t1.返回主菜单;

\n\t2.退出\n\t\t请选择:

scanf("

re);

break;

}

case2:

\n\t2.查看信息\n"

output();

\n\t1.返回主菜单;

\n\t2.退出\n\t\t请选择:

case3:

while(t==1)

{

printf("

\n\t3.查询信息\n"

\n\t请选择查询方式:

\n\t1.按书名\n\t2.按作者名\n\t3.其余任意数字键返回主菜单_\b\b"

n);

if(n==1)

book_name();

elseif(n==2)

author_name();

else

{

re=1;

gotolebel;

}

\n\t1.返回上一层;

\n\t2.返回主菜单;

\n\t3.退出\n\t请选择:

t);

if(t==1)

system("

if(t==2)

re=1;

if(t==3)re=0;

}

lebel:

break;

case4:

while(t==1||f==1)

\n\t4.删除与修改信息\n"

\n\t请选择:

\n\t1.删除信息;

\n\t2.修改信息\n\t3.其余任意数字键返回主菜单_\b\b"

delet();

modify();

gotolebe;

\n\t3.退出\n\t\t请选择:

if(t==1)

if(t==2)re=1;

lebe:

case5:

re=0;

break;

default:

re=1;

j=1;

}

}

return0;

}

intsave()

{

FILE*fp;

inti,n=0,n1=0;

if((fp=fopen("

book.txt"

"

a+"

))==NULL)

return0;

fprintf(fp,"

%d\n"

num);

for(i=0;

i<

num;

i++)

{

fprintf(fp,"

%d%s%s%d%s%s%d"

P[i].sort,P[i].book_name,

P[i].author_name,P[i].vert_number,P[i].publish_unit,P[i].publish_time,P[i].price);

fclose(fp);

return1;

intget()

inti;

fp=fopen("

r"

if(fp==NULL)

else

fscanf(fp,"

num);

if(num>

0)

P=(B*)malloc(LEN*num);

for(i=0;

fscanf(fp,"

%d%s%s%d%s%s%d"

P[i].sort,P[i].book_name,

P[i].author_name,&

P[i].vert_number,P[i].publish_unit,P[i].publish_time,&

P[i].price);

fclose(fp);

return1;

else

return0;

voidinput()

intresult;

\t\t要录入信息的书籍数量为:

__本\b\b"

P=(B*)malloc(LEN*num);

P[i].sort=i+1;

\n\tNO.%d"

P[i].sort);

printf("

\t请按序输入:

书名作者名分类号出版单位出版时间价格\n\t\t"

scanf("

%s%s%d%s%s%d"

P[i].book_name,P[i].author_name,&

P[i].vert_number,P[i].publish_unit,

P[i].publish_time,&

result=save();

if(result==0)

\t录入信息失败!

num=0;

if(result==1)

\t成功录入信息!

num=0;

\t输入错误!

voidoutput()

get();

if(get()==1)

\n\t\t成功获取信息!

\n\t\tNO.\t%d\n"

\t\t书名作者名序列号出版单位出版时间价格\n"

\t\t%s%s%d%s%s%d"

P[i

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 人文社科 > 法律资料

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1