资源描述:
《c语言商店销售管理系统课程设计》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、商店销售管理系统#include#include#defineN1000//N代表货物的最大种类structgoods{charname[10];//商品名称intamount;//商品数量intnum;//商品编号floatprice;//商品价格}sp[N],sc[N];//定义全局变量intflag=1;FILE*fp;inti=0;intk=0;intb=0;chakan()//显示目前的库存{intzong=0;fp=fopen("chaoshi.txt"
2、,"r");for(i=1;i<=(k+b);i++)fread(&sp[i],sizeof(structgoods),1,fp);fclose(fp);for(i=1;i<=k;i++){zong=zong+sp[i].num;}if(zong!=0){printf("目前库存情况为:名称数量价格编号");for(i=1;i<=(k+b);i++){printf("%stheprovisionsofelectricpowerconstructionengineeringqualitysuper
3、visionandquality...2.4.1.1theunitworksacceptancerateof100%,thequalityevaluationofatotalscoreof95orabove;2.4.1.2regulatedWeldingNDTinspection100%,regulatedweldingapassingrateof>99%,andweldbeadappearance;2.4.1.3boilerhydraulic%d%f%d",sp[i].name,sp[i].a
4、mount,sp[i].price,sp[i].num);}}elseprintf("#####目前库存为#####");}jinhuo()//进货模块{do{k++;i++;printf("请输入商品的名称.数量.价格.标号(>0)例如:a12.5111ttt");scanf("%s%d%f%d%c",sp[i].name,&sp[i].amount,&sp[i].price,&sp[i].num);printf("是否继续,是(1),否(0)ttt");scanf("
5、%d",&flag);}while(flag!=0);fp=fopen("chaoshi.txt","w");for(i=1;i<=k;i++)fwrite(&sp[i],sizeof(structgoods),1,fp);fclose(fp);chakan();}xiaoshou()//销售模块{floatm[100];intz=1;intj[100];inta[100];intg=0;inty=0;theprovisionsofelectricpowerconstructionengineeri
6、ngqualitysupervisionandquality...2.4.1.1theunitworksacceptancerateof100%,thequalityevaluationofatotalscoreof95orabove;2.4.1.2regulatedWeldingNDTinspection100%,regulatedweldingapassingrateof>99%,andweldbeadappearance;2.4.1.3boilerhydraulicinth=0;floatzo
7、ng=0;fp=fopen("chaoshi.txt","r");for(i=1;i<=k;i++)fread(&sp[i],sizeof(structgoods),1,fp);fclose(fp);do{g++;y++;loop:printf("请输入商品编号和数量,例如:(10020)ttt");scanf("%d%d",&j[y],&a[y]);for(z=1;z<=k;z++){if(j[y]==sp[z].num){h++;sp[z].amount=sp[z].amount-a[
8、y];m[y]=(float)a[y]*sp[z].price;sc[y]=sp[z];}}if(h==0){printf("输入有误,请重新输入ttt");gotoloop;}fp=fopen("chaoshi.txt","wt");for(i=1;i<=k;i++)fwrite(&sp[i],sizeof(structgoods),1,fp);fclose(fp);printf("是否继续,是(1),否(0)ttt");scanf("%d",&