商品订购系统设计资料Word格式文档下载.docx

上传人:b****1 文档编号:13284973 上传时间:2022-10-09 格式:DOCX 页数:17 大小:18.64KB
下载 相关 举报
商品订购系统设计资料Word格式文档下载.docx_第1页
第1页 / 共17页
商品订购系统设计资料Word格式文档下载.docx_第2页
第2页 / 共17页
商品订购系统设计资料Word格式文档下载.docx_第3页
第3页 / 共17页
商品订购系统设计资料Word格式文档下载.docx_第4页
第4页 / 共17页
商品订购系统设计资料Word格式文档下载.docx_第5页
第5页 / 共17页
点击查看更多>>
下载资源
资源描述

商品订购系统设计资料Word格式文档下载.docx

《商品订购系统设计资料Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《商品订购系统设计资料Word格式文档下载.docx(17页珍藏版)》请在冰豆网上搜索。

商品订购系统设计资料Word格式文档下载.docx

voidproincrease();

/*增加商品*/

voidprosave();

/*proincrease()调用的存储函数*/

voidproopen();

/*proincrease()调用的显示函数*/

voidprodelete();

/修改商品,开发中*/

voidpromodify();

/*修改商品,开发中*/

voidload();

/*浏览商品进入选购*/

voidorder();

/*输入编号订购*/

voidinputaddress();

/*输入邮寄地址*/

voidorderquantity();

/*输入订购数量*/

voidconfirmorder();

/*确认订购*/

voidconfirmfilesave();

/*写入文件*/

voidconfirmfileopen();

/*显示订购信息*/

voidgoonorder();

/*继续订购*/

voidaccount();

/*结账模块*/

voidloginout();

/*退出系统*/

voidsuccess();

/*订购成功,退出*/

voidmain()/*主程序*/

{

select();

}

intOrdernum=0;

intj=0;

intLast;

floatusersum=0.00;

structproduct/*商品结构*/

intproductnum;

/*商品编号*/

charproductname[MAXSTRLEN];

/*商品名称*/

charproducttype[MAXSTRLEN];

/*商品型号*/

floatproductprice;

/*商品价格*/

charproductplace[MAXSTRLEN];

/*商品产地*/

intproductstock;

/*库存数量*/

intproductordered;

/*已订购数量*/

}pro[PRODUCTQUANTITY];

structuserproduct/*用户结构*/

intusernum;

/*用户订购商品编号*/

intuserquantity;

/*用户订购数量*/

}userpro[USERPROMAX];

voidDispMainmenu()/*主菜单*/

system("

cls"

);

printf("

\n\n\n\n\n\n"

**************************欢迎使用商品订购系统v1.0******************************\n\n"

┏━━━━━━━━━━━━━━━━━━━┓\n"

┃1.浏览商品┃\n"

┃2.按名称查找┃\n"

┃3.按型号查找┃\n"

┃4.管理维护┃\n"

┃0.退出系统┃\n"

┗━━━━━━━━━━━━━━━━━━━┛\n\n\n"

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

请选择0~4:

"

voidDispMaintainmenu()/*管理维护菜单*/

\n\n\n\n\n\n\n"

******************************管理维护子菜单************************************\n\n"

┃1.查看商品┃\n"

┃2.增加商品┃\n"

┃3.删除商品┃\n"

┃4.修改商品┃\n"

┃0.返回主菜单┃\n"

voidselect()/*选择菜单*/

loop1:

DispMainmenu();

{charch1;

do

ch1=getch();

while(ch1<

'

0'

||ch1>

4'

switch(ch1)

{

case'

1'

:

load();

break;

2'

namefind();

3'

typefind();

DispMaintainmenu();

{charch2;

do

ch2=getch();

while(ch2<

||ch2>

switch(ch2)

{

case'

open();

gotoloop1;

proincrease();

prodelete();

promodify();

gotoloop1;

default:

}

}

}break;

\n\n\n\n\n\n\n\n\n\n\n\n谢谢使用,再见!

\n\n\n\n\n\n\n\n\n\n\n\n\n"

default:

}

}

voidopen()/*管理员浏览*/

{inti;

FILE*fp;

fp=fopen("

shangpin.dat"

"

rb"

printf("

\n\n\n\n\n\n\n\n编号名称型号价格产地库存已订购\n"

for(i=0;

i<

PRODUCTQUANTITY;

i++)

{fread(&

pro[i],sizeof(structproduct),1,fp);

%4d%-10s%-12s%9.2f%-5s%5d%4d\n"

pro[i].productnum,pro[i].productname,pro[i].producttype,pro[i].productprice,pro[i].productplace,pro[i].productstock,pro[i].productordered);

fclose(fp);

\n\n\n\n\n共有%d条记录!

\n\n"

i);

按任意键继续……"

getch();

 

voidnamefind()/*按名称查找*/

{inti,k,r=0;

charstr[MAXSTRLEN],c3;

system("

\n请输入你要查找的名称:

scanf("

%s"

&

str);

\n您所查找的%s\n"

str);

{fread(&

k=strcmp(pro[i].productname,str);

if(k==0)

{printf("

r=r+1;

\n共有%d条记录!

\n"

r);

if(r!

=0)

进入选购请按任意键,结账请按p,取消请按ESC:

c3=getch();

if(c3==27)

select();

elseif(c3=='

p'

||c3=='

P'

account();

order();

else

\n按任意键继续……\n"

getchar();

voidtypefind()/*按型号查找*/

\n请输入你要查找的型号:

%

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

当前位置:首页 > 解决方案 > 学习计划

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

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