1 / 53
文档名称:

程序设计大作业代码及说明书-图书销售管理系统.docx

格式:docx   大小:81KB   页数:53页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

程序设计大作业代码及说明书-图书销售管理系统.docx

上传人:飞鱼2019 2022/5/11 文件大小:81 KB

下载得到文件列表

程序设计大作业代码及说明书-图书销售管理系统.docx

相关文档

文档介绍

文档介绍:程序设计说明书
〔图书销售管理系统〕
//ISBN 号
//图书名称
〃价格
//最初书店中的库存
//当前存货量
//销售量
//是否促销
//单链表中指向下一
//图书数量,需要在
图书销售系统:程序代码
empnode;
}〃创建单链表,对数据进展录入,同时录入数组
cursor=NULL;tempnode=NULL;
return mylist;//返回单链表首地址
}
void freellist(struct book *head)
{
struct book *ptr;
while (head!=NULL)
//
遍历链表
ptr=head;
head = head->next;
//
指向下一节点
ptr->next=NULL;
free(ptr);
//
释放结构体
}
int search(char *l)
{
struct book *booksearch;
for(booksearch=bklist->next;booksearch!=NULL;booksearch=booksearch->next)
{
if(strcmp(l,booksearch->ISBN)==0)
{
column。;
show(booksearch);
booksearch=NULL;
return 0;
}
}
printf("抱歉,没有找到相应的图书。\n\n");
booksearch=NULL;
return 1;
}〃利用单链表进展ISBN查找
void keyword(char a[])
{
int i,j,k;
int length,lengthi,flag=0,flag1=0,temp,temp0;
length=strlen(a);// 关键词的长度
flag=0;flag1=0;
column();
for(i=0;i<n;i++)
{
lengthi=strlen(bk[i].name);
for(j=0;j+length<lengthi;j++)
for(k=0;k<length;k++)
{
temp=a[k];temp0=bk[i].name[j+k];
flag+=(temp0-temp)*(temp0-temp);
}
if(flag==0)
{
flag1++;show(&bk[i]);break;
}
else flag=0;
}
} if(flag1==0)printf("抱歉,没有找到相应的图书。\n\n");
} 〃关键词查找:查找结果为书名中包含查找内容〔作为整体〕的相应书籍的全部内容
void bubblesort(void)
{
int i;
struct book *a,*b,*c;
ordershow("销量由高到低排序");
for(i=0;i<n;i++)
for (a=bklist;a->next->next!=NULL;a=a->next)
{
b=a->next;c=b->next->next;
if (b->sale<b->next->sale)
{
a->next=b->next;
a->next->next=b;
b->next=c;
}
}
column();
for(c=bklist->next;c!=NULL;c=c->next)
{
show(c);
}
c=NULL;b=NULL;a=NULL;
}〃用单链表进展冒泡排序,打印出按照销量由高到低的排行榜
void selectsort(struct book a[])
{
int i,j,min;
struct book *pb[50],*tempb;
ordershow("价格由低到高排行");
for (i=0;i<n;i++)
pb[i]=&a[i];
for(i=0;i<n;i++)
{
min=i;
for(j=i;j<n;j++)
if(pb[min]->price>pb[j]->price)
min=j;
}
tempb=pb[i];pb[i]=pb[min];pb[min]=tempb;
}
column。;
for (i=0;i<n;i++)
show(pb[i]);
tempb=NULL;
for(i=0;i<49;i++)
pb[i]=NULL;
}//对图书数组进展选择排序,打印出图书价格由低到高的排行榜
void insertsort(struct book a口)
{
int i