欢迎来到三一文库! | 帮助中心 三一文库31doc.com 一个上传文档投稿赚钱的网站
三一文库
全部分类
  • 研究报告>
  • 工作总结>
  • 合同范本>
  • 心得体会>
  • 工作报告>
  • 党团相关>
  • 幼儿/小学教育>
  • 高等教育>
  • 经济/贸易/财会>
  • 建筑/环境>
  • 金融/证券>
  • 医学/心理学>
  • ImageVerifierCode 换一换
    首页 三一文库 > 资源分类 > DOC文档下载  

    [计算机软件及应用]2011-2012-2《程序设计实践》课程报告统一格式 1.doc

    • 资源ID:1991418       资源大小:892.50KB        全文页数:36页
    • 资源格式: DOC        下载积分:6
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录   微博登录  
    二维码
    微信扫一扫登录
    下载资源需要6
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    [计算机软件及应用]2011-2012-2《程序设计实践》课程报告统一格式 1.doc

    课 程 报 告课 程 名 称: 程序设计实践 专 业 班 级 : 信息类1108班 学 生 姓 名 : 孟奇 学 号 : 201116910827 任 课 教 师 : 阎娟 学 期 :20101-2012学年第二学期 课程报告任务书题 目图书信息管理系统主要内容开发一个图书信息管理系统,图书信息包括:图书编号、书名、作者、出版社、类别、出版时间、价格等基本信息(也可以根据自己情况进行扩充,比如是否借出、库存量等)。使之能提供以下基本功能:(1)图书信息录入功能(图书信息用文件保存)输入v(2)图书信息浏览功能输出(3)查询功能(至少一种查询方式)、排序功能(至少一种排序方式): l 按书名查询 按作者名查询 按照价钱排序 按出版时间排序等等(4)图书信息的删除与修改扩展功能:可以按照自己的程度进行扩展。比如(1)简单的权限处理 (2)报表打印功能(3)甚至根据自己情况,可以加上学生信息,并扩充为图书借阅系统。(4)模糊查询 (5)综合查询 (6)统计功能 比如统计处某一类别的图书信息 或 筛选出小于指定数量库存的图书信息等等,总之,可以根据自己需求进行分析功能。任务要求一、提交材料应包括:(1)系统源代码 (2)课程报告二、整个设计过程具体要求(1)需求分析 要求学生对案例系统进行分析,设计出需要完成的功能,完善各个模块的调用关系;(2)设计过程 要求学生进一步明确各模块调用关系,进一步完善模块函数细节(函数名、参数、返回值等)(3)实现过程 要求学生养成良好的编码习惯、完成各个模块并进行测试,最终完成系统整体测试;(4)总结阶段 按照要求完成系统设计和实现报告,并进行总结、答辩。成绩评定报告撰写情况(30分)系统完成情况(30分)答辩情况(40分)总分内容20分规范程度5分程序测试5分基本功能20分扩展功能10分自述情况10分答辩情况30分成绩评定教师: 361 需求分析基本功能:(1)图书信息录入功能(图书信息用文件保存)输入v(2)图书信息浏览功能输出(3)查询功能(至少一种查询方式)、排序功能(至少一种排序方式): l 按书名查询 按作者名查询 按照价钱排序 按出版时间排序等等(4)图书信息的删除与修改扩展功能:可以按照自己的程度进行扩展。比如(1)简单的权限处理 (2)报打印功能(3)甚至根据自己情况,可以加上学生信息,并扩充为图书借阅系统。(4)模糊查询 (5)综合查询 (6)统计功能 比如统计处某一类别的图书信息 或 筛选出小于指定数量库存的图书信息等等,总之,可以根据自己需求进行分析功能。2 概要设计可适当参考以下提示: 数据结构struct book int bianhao;/图书编号char shuming20;/书名char zuozhe20;/作者char chubanshe20;/出版社char leibie20;/图书类别int time;/图书出版时间double jiage;/图书价格struct book *next;/用于构建链表指向下一结点; 模块划分void luru(); /录入图书信息函数,并放入链表中void shuchu(); /输出void charu(); /插入void tongji(); /统计void anbianhaopaixu(); /按编号排序void anjiagepaixu(); /按价格排序struct book *anbianhaochaxun(); /按编号查询struct book *anshumingchaxun(); /按书名查询struct book *anchubanshechaxun(); /按出版社查询struct book *anzuozhechaxun(); /按作者查询void shanchutushu(); /删除图书void xiugaitushu(); /修改图书 程序总体框架由主函数进入程序 输出主菜单 图书管理系统1-录入图书信息函数,并放入链表 2-输出图书信息 3-插入图书信息 4-统计图书 5-按编号排序 6-按价格排序 7-按编号查询 8-按书名查询 9-按出版社查询 10-按作者查询 11-删除图书 12-修改图书 0-退出 输入对应编号0退出 12修改图书 10按作者查询11删除图书1图书入库 2输出图书信息3插入图书信息 4统计图书5按编号排序6按价格排序7按编号查询 8按书名查询9按出版社查询 3 详细设计主函数void main()源程序void main()int i,x=1,k=0;while(x)system("cls");printf("n");printf("*n");printf("*n"); printf("*欢迎进入图书管理系统*n"); printf(" 0-退出系统 1-录入数据 n");printf(" 2-输出信息 3-插入数据 n");printf(" 4-统计书数 5-按编号排序 n");printf(" 6-按价格排序 7-按编号查询 n");printf(" 8-按书名查询 9-按出版社查询 n");printf(" 10-按作者查询 11-修改图书 n");printf(" 12-删除图书 n"); printf("*n");printf("*n");printf("请输入选择:");scanf("%d",&i);getchar();switch(i)case 0:x=0;break;case 1:luru();break;case 2:shuchu();break;case 3:charu();break;case 4:tongji();break;case 5:anbianhaopaixu();break;case 6:anjiagepaixu();break;case 7:anbianhaochaxun();break;case 8:anshumingchaxun();break;case 9:anchubanshechaxun();break;case 10:anzuozhechaxun();break;case 11:xiugaitushu();break;case 12:shanchutushu();break;default :printf("对不起,您输入有误,请重新输入!");getchar();break;录入图书信息函数,并放入链表1、函数原型void luru(); 函数功能:得到学生的数据,并放入到链表中2、源程序void luru()FILE *fb;struct book *p1,*p2,*head;int sum=0,n=0;printf("注意:当学生编号为 0 时输入结束nn");p1=(struct book *)malloc(sizeof(struct book); /*得到学生信息*/head=p2=p1;doprintf("请输入图书的编号:");scanf("%d",&p1->bianhao);if(p1->bianhao=0)break;printf("请输入图书的名字:");scanf("%s",p1->shuming);printf("请输入图书的作者:");scanf("%s",p1->zuozhe);printf("请输入图书的出版社:");scanf("%s",p1->chubanshe); printf("请输入图书的类别:");scanf("%s",p1->leibie); printf("请输入图书的出版时间:");scanf("%d",&p1->time);printf("请输入图书的价格:");scanf("%lf",&p1->jiage);getchar();printf("n");p2->next=p1;p2=p1;n+;p1=(struct book *)malloc(sizeof(struct book);while(1);p2->next=NULL;printf("图书信息输入结束!n");getchar();/*学生的数据被放在链表中*/图书信息从链表中写入文件if(fb=fopen("图书信息.txt","w")=NULL)printf("文件'图书.txt'打开失败!");exit(0);for(p1=head;p1!=NULL;p1=p1->next)fprintf(fb,"%10d %20s %10s %20s %20s %10d %lfn",p1->bianhao,p1->shuming,p1->zuozhe,p1->chubanshe,p1->leibie,p1->time,p1->jiage);fclose(fb);printf("更改成功,新的文件成功保存到'图书信息.txt'中!n");getchar();输出函数原型:void shuchu()函数功能:实现对图书信息的输出2、源程序void shuchu()FILE *fp;struct book *p1,*head,*tail;head=NULL; if(fp=fopen("图书信息.txt","r")=NULL) printf("文件图书信息.txt打开失败"); exit(0); while(!feof(fp) p1=(struct book *)malloc(sizeof(struct book); fscanf(fp,"%10d %20s %10s %20s %20s %10d %lfn",&p1->bianhao,p1->shuming,p1->zuozhe,p1->chubanshe,p1->leibie,&p1->time,&p1->jiage); printf("请输入图书的编号:%dn",p1->bianhao);printf("请输入图书的名字:%sn",p1->shuming);printf("请输入图书的作者:%sn",p1->zuozhe);printf("请输入图书的出版社:%sn",p1->chubanshe); printf("请输入图书的类别:%sn",p1->leibie); printf("请输入图书的出版日期:%dn",p1->time);printf("请输入图书的价格:%.2lfn",p1->jiage);printf("n"); if(head=NULL) head=p1; else tail->next=p1; tail=p1; tail->next=NULL; getchar(); fclose(fp);插入函数原型: void charu()源程序:void charu()FILE *fp;struct book *p1; if(fp=fopen("图书信息.txt","a")=NULL) printf("文件图书信息.txt打开失败"); exit(0); p1=(struct book *)malloc(sizeof(struct book); /*得到学生信息*/printf("请输入图书的编号:");scanf("%d",&p1->bianhao);printf("请输入图书的名字:");scanf("%s",p1->shuming);printf("请输入图书的作者:");scanf("%s",p1->zuozhe);printf("请输入图书的出版社:");scanf("%s",p1->chubanshe); printf("请输入图书的类别:");scanf("%s",p1->leibie); printf("请输入图书的出版时间:");scanf("%d",&p1->time);printf("请输入图书的价格:");scanf("%lf",&p1->jiage);getchar();fprintf(fp,"%10d %20s %10s %20s %20s %10d %lfn",p1->bianhao,p1->shuming,p1->zuozhe,p1->chubanshe,p1->leibie ,p1->time,p1->jiage);printf("更改成功,新的文件成功保存到'图书信息.txt'中!n");getchar();fclose(fp);统计图书1、函数原型:void tongji()2、源程序void tongji()FILE *fp;struct book *p1;int n; if(fp=fopen("图书信息.txt","r")=NULL) printf("文件图书信息.txt打开失败");exit(0); p1=(struct book *)malloc(sizeof(struct book);n=0; while(!feof(fp) fscanf(fp,"%10d %20s %10s %20s %20s %10d %lfn",&p1->bianhao,p1->shuming,p1->zuozhe,p1->chubanshe,p1->leibie,&p1->time,&p1->jiage); n+; printf("目前存储的图书总数为:%d",n); getchar(); fclose(fp);按编号排序1、函数原型:void anbianhaopaixu()2、源程序void anbianhaopaixu()FILE *fp;struct book *p,*p1,*p2,*head,*tail,temp;int changdu=0,i; head=NULL;if(fp=fopen("图书信息.txt","r")=NULL) printf("文件图书信息.txt打开失败"); exit(0); while(!feof(fp) p1=(struct book *)malloc(sizeof(struct book); fscanf(fp,"%10d %20s %10s %20s %20s %10d %lfn",&p1->bianhao,p1->shuming,p1->zuozhe,p1->chubanshe,p1->leibie,&p1->time,&p1->jiage); if(head=NULL) head=p1; else tail->next=p1; tail=p1; tail->next=NULL; fclose(fp);/计算链表长度p=head;while(p!=NULL)p=p->next;changdu+;/按编号冒泡排序链表for(i=1;i<changdu;i+)for(p1=head,p2=p1->next;p1->next !=NULL;p1=p1->next,p2=p2->next)if(p1->bianhao>p2->bianhao)temp.bianhao=(*p1).bianhao;strcpy(temp.shuming,(*p1).shuming);strcpy(temp.zuozhe,(*p1).zuozhe);strcpy(temp.chubanshe,(*p1).chubanshe); strcpy(temp.leibie,(*p1).leibie);temp.time=(*p1).time;temp.jiage=(*p1).jiage;(*p1).bianhao=(*p2).bianhao;strcpy(*p1).shuming,(*p2).shuming);strcpy(*p1).zuozhe,(*p2).zuozhe);strcpy(*p1).chubanshe,(*p2).chubanshe); strcpy(*p1).leibie,(*p2).leibie); (*p1).time=(*p2).time;(*p1).jiage=(*p2).jiage;(*p2).bianhao=temp.bianhao;strcpy(*p2).shuming,temp.shuming);strcpy(*p2).zuozhe,temp.zuozhe);strcpy(*p2).chubanshe,temp.chubanshe); strcpy(*p2).leibie,temp.leibie); (*p2).time=temp.time; (*p2).jiage=temp.jiage;p=head;while(p!=NULL)printf("请输入图书的编号:%dn",p->bianhao);printf("请输入图书的名字:%sn",p->shuming);printf("请输入图书的作者:%sn",p->zuozhe);printf("请输入图书的出版社:%sn",p->chubanshe); printf("请输入图书的类别:%sn",p->leibie); printf("请输入图书的出版时间:%dn",p->time);printf("请输入图书的价格:%.2lfn",p->jiage);printf("n");p=p->next; getchar();按价格排序1、函数原型:id anjiagepaixu()2、源程序void anjiagepaixu()FILE *fp;struct book *p,*p1,*p2,*head,*tail,temp;int changdu=0,i; head=NULL;if(fp=fopen("图书信息.txt","r")=NULL) printf("文件图书信息.txt打开失败"); exit(0); while(!feof(fp) p1=(struct book *)malloc(sizeof(struct book); fscanf(fp,"%10d %20s %10s %20s %20s %10d %lfn",&p1->bianhao,p1->shuming,p1->zuozhe,p1->chubanshe,p1->leibie,&p1->time,&p1->jiage); if(head=NULL) head=p1; else tail->next=p1; tail=p1; tail->next=NULL; fclose(fp);/计算链表长度p=head;while(p!=NULL)p=p->next;changdu+;/按编号冒泡排序链表for(i=1;i<changdu;i+)for(p1=head,p2=p1->next;p1->next !=NULL;p1=p1->next,p2=p2->next)if(p1->jiage>p2->jiage)temp.bianhao=(*p1).bianhao;strcpy(temp.shuming,(*p1).shuming);strcpy(temp.zuozhe,(*p1).zuozhe);strcpy(temp.chubanshe,(*p1).chubanshe); strcpy(temp.leibie,(*p1).leibie);temp.time=(*p1).time;temp.jiage=(*p1).jiage;(*p1).bianhao=(*p2).bianhao;strcpy(*p1).shuming,(*p2).shuming);strcpy(*p1).zuozhe,(*p2).zuozhe);strcpy(*p1).chubanshe,(*p2).chubanshe); strcpy(*p1).leibie,(*p2).leibie); (*p1).time=(*p2).time;(*p1).jiage=(*p2).jiage;(*p2).bianhao=temp.bianhao;strcpy(*p2).shuming,temp.shuming);strcpy(*p2).zuozhe,temp.zuozhe);strcpy(*p2).chubanshe,temp.chubanshe); strcpy(*p2).leibie,temp.leibie); (*p2).time=temp.time;(*p2).jiage=temp.jiage;p=head;while(p!=NULL)printf("请输入图书的编号:%dn",p->bianhao);printf("请输入图书的名字:%sn",p->shuming);printf("请输入图书的作者:%sn",p->zuozhe);printf("请输入图书的出版社:%sn",p->chubanshe); printf("请输入图书的出版日期:%dn",p->time);printf("请输入图书的价格:%.2lfn",p->jiage);printf("n");p=p->next; getchar();按编号查询1、函数原型:struct book *anbianhaochaxun()2、源程序struct book *anbianhaochaxun()FILE *fp;struct book *p1,*head,*tail,*p0;int bianhao; head=NULL;if(fp=fopen("图书信息.txt","r")=NULL) printf("文件图书信息.txt打开失败"); exit(0); while(!feof(fp) p1=(struct book *)malloc(sizeof(struct book); fscanf(fp,"%10d %20s %10s %20s %10d %lfn",&p1->bianhao,p1->shuming,p1->zuozhe,p1->chubanshe,&p1->time,&p1->jiage); if(head=NULL) head=p1; else tail->next=p1; tail=p1; tail->next=NULL; fclose(fp);printf("请输入要查询的图书编号:");scanf("%d",&bianhao);getchar();p0=head;while(p0!=NULL)if(p0->bianhao=bianhao)break;p0=p0->next;if(p0=NULL)printf("没有找到编号为 %d 的图书!n",bianhao);getchar();return NULL;elseprintf("要查询的图书信息如下:nn");printf("请输入图书的编号:%dn",p0->bianhao);printf("请输入图书的名字:%sn",p0->shuming);printf("请输入图书的作者:%sn",p0->zuozhe);printf("请输入图书的出版社:%sn",p0->chubanshe); printf("请输入图书的出版日期:%dn",p0->time);printf("请输入图书的价格:%.2lfn",p0->jiage);getchar();return p0;按书名查询1、函数原型:struct book *anshumingchaxun()2、源程序struct book *anshumingchaxun()FILE *fp;struct book *p1,*head,*tail,*p0;char shuming20;int flag; head=NULL;if(fp=fopen("图书信息.txt","r")=NULL) printf("文件图书信息.txt打开失败"); exit(0); while(!feof(fp) p1=(struct book *)malloc(sizeof(struct book); fscanf(fp,"%10d %20s %10s %20s %20s %10d %lfn",&p1->bianhao,p1->shuming,p1->zuozhe,p1->chubanshe,p1->leibie,&p1->time,&p1->jiage); if(head=NULL) head=p1; else tail->next=p1; tail=p1; tail->next=NULL; fclose(fp);flag=0;printf("请输入要查询的图书名称:");gets(shuming);p0=head;while(p0!=NULL)if(strcmp(p0->shuming,shuming)=0)break;flag=1;p0=p0->next;if(p0=NULL&&flag=0)printf("没有找到名称为 %s 的图书!n",shuming);getchar();return NULL;elseprintf("要查询的图书信息如下:nn");printf("请输入图书的编号:%dn",p0->bianhao);printf("请输入图书的名字:%sn",p0->shuming);printf("请输入图书的作者:%sn",p0->zuozhe);printf("请输入图书的出版社:%sn",p0->chubanshe); printf("请输入图书的出版时间:%dn",p0->time);printf("请输入图书的价格:%.2lfn",p0->jiage);getchar();return p0;按出版社查询函数原型:struct book *anchubanshechaxun()源程序:struct book *anchubanshechaxun()FILE *fp;struct book *p1,*head,*tail,*p0;char chubanshe20;int flag; head=NULL;if(fp=fopen("图书信息.txt","r")=NULL)

    注意事项

    本文([计算机软件及应用]2011-2012-2《程序设计实践》课程报告统一格式 1.doc)为本站会员(音乐台)主动上传,三一文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    经营许可证编号:宁ICP备18001539号-1

    三一文库
    收起
    展开