c语言程序设计课程设计--仓库管理内容摘要:

int judge_time(char a[])。 /*判断时间 是否合法 , 不合法返回 0,合法返回 1*/ define M 10 define N 5 /*仓库负责人姓名 */ 第 13 页 共 13 页 学生简历管理系统 define principal_name1 刘德华 define principal_name2 张学友 define principal_name3 郭富城 define principal_name4 黎 明 define principal_name5 梁朝伟 /*仓库名称 */ define spec_name1 仓库 1 define spec_name2 仓库 2 define spec_name3 仓库 3 define spec_name4 仓库 4 define spec_name5 仓库 5 /*产品名称 */ define product_name1 花生奶 define product_name2 果粒橙 define product_name3 优先乳 define product_name4 肖飘飘 define product_name5 美之源 define product_name6 冰红茶 define product_name7 爽歪歪 define product_name8 美年达 define product_name9 优乐美 define product_name10 舒化奶 第 14 页 共 13 页 学生简历管理系统 /*产品规格 */ define product_guige1 AD121 define product_guige2 AD122 define product_guige3 AD123 define product_guige4 AD124 define product_guige5 AD125 /*定义仓库结构体 */ struct storage { }。 /*定义产品信息结构体 */ struct product { }。 第 15 页 共 13 页 int storage_number。 /*仓库编号 */ char storage_name[50]。 /*仓库名称 */ char fuzeren_name[50]。 /*负责人姓名 */ int product_number。 /*产品编号*/ int amount。 /* 产品数量 */ char product_name[50]。 /* 产品名称 */ char product_guige[30]。 /*产品规格 */ 学生简历管理系统 /*定义链表结点 */ struct information { */ }。 /*主函数 */ main(){ int choice。 struct information *head=NULL。 /*入库链表头指针 */ /* struct information *next。 /*存放下一结点地址 */ struct storage stor[N]。 /*仓库数组 */ struct product pro[M]。 /*产品数组 */ char tim[30]。 /*时间变量 */ int flag。 /*判断是入库还是出库 1 表示入库 1 表示出库出库链表头指针 */ do{ printf(\n\n)。 printf(\t\t******************************** 仓 库 管 理 系 统******************************\n)。 printf(\t\t\t\t\t产品入库 (键盘输入信息 ) \n\n)。 第 16 页 共 13 页 学生简历管理系统 printf(\t\t\t\t\t产品出库 (键盘输入信息 )\n\n)。 printf(\t\t\t\t\t查询指定仓库编号的入库记录 \n\n)。 printf(\t\t\t\t\t查询指定产品编号的入库记录 \n\n)。 printf(\t\t\t\t\t查询指定仓库编号的出库记录 \n\n)。 printf(\t\t\t\t\t查询指定产品编号的出库记录 \n\n)。 printf(\t\t****************************************** printf(\t\t\t\t\t7 、退出 \n)。 *******************************\n)。 printf(\t\t\t请您选择 17之间的数字选择对应的功能 ......\n )。 scanf(%d,amp。 choice)。 switch(choice){ case 1: system(cls)。 head=enter_spec(head)。 第 17 页 共 13 页 学生简历管理系统 break。 case 2: system(cls)。 head=out_spec(head)。 break。 case 3: system(cls)。 look_up_enter_spec_information(head)。 break。 case 4: system(cls)。 look_up_enter_product_information(head)。 break。 case 5: system(cls)。 look_up_out_spec_information(head)。 break。 case 6: system(cls)。 look_up_out_product_information(head)。 break。 case 7:system(cls)。 printf(\n\n\n\n 谢谢使用本系统 ,欢迎下次光临 !\n )。 exit(0)。 第 18 页 共 13 页 学生简历管理系统 } } printf( 按 回 车 键 继 续 !)。 getchar()。 system(cls)。 }while(choice!=9)。 /*定义入库函数 */ struct information *enter_spec (struct information *head) { int number1,number2,amount。 int i,flag1,flag2。 char a[20]。 struct information *p,*tail。 flag1=0。 flag2=0。 第 19 页 共 13 页 学生简历管理系统 tail=head。 printf(\t\t\t 如果您要结束 ,请输入 0, 然后回车 !\n\n)。 printf( 仓库编号 (数字 1— 5)\n)。 printf( 产品编号 (数字1— 10)\n)。 printf( 入库时间 ( 格式为 :YYYYMMDD)\n)。 printf( 入库数量 (数字 12147483647,禁止输入其它数 )\n)。 printf( 请 按 提 示 顺 序 输 入 , 中 间 用 空 格 隔 开 \n)。 scanf(%d,amp。 number1)。 while(number1!=0){ scanf(%d%s%d,amp。 number2,a,amp。 amount)。 p=(struct information *)malloc(sizeof(struct information))。 /*申请 /*下面判断 编 号 是 否 合 法 */ if(number11||number15||number21||number210){ printf( 输入编号不合法,请重新输入 !\n)。 free(p)。 continue。 /*跳到循环开始,重新输入 */ } /*下面判断时间是否合法 */ 第 20 页 共 13 页 学生简历管理系统 if(!judge_time(a))/*时间合法返回非 0*/ { printf( 输入时间不合法,请重新输入 !\n)。 free(p)。 continue。 /*跳到循环开始,重新输入 */ } /*判断仓库编号、产品编号、时间是否已存在 */ if(judge_num(head,number1,number2,a)==1) { int choice。 printf( 该产品已存在,您要提取货物吗。 \n)。 printf( 提取货物 \n)。 printf( 不提取,重新输入入库信息 \n)。 scanf(%d,amp。 choice)。 switch(choice) { case 1: system(cls)。 out_spec(head)。 /*调用出库函数*/ printf(货物已经成功提取,按任意键退出 !\n)。 getchar()。 getchar()。 第 21 页 共 13 页 学生简历管理系统 return 0。 case 2: system(cls)。 free(p)。 /*释放刚申请的 continue。 /*跳到循环开始,重新输入 */ } } /*判断数量是否大于 0*/ if(amount=0) { printf( 产品数量必须大于 0,请您重新输入\n)。 free(p)。 continue。 } /*若满足上述所有条件,则将结点插入链表 */ /*仓库名称 */ strcpy(pstor[1].storage_name,spec_name1 )。 strcpy(pstor[2].storage_name,spec_name2 )。 strcpy(pstor[3].storage_name,spec_name3 )。 第 22 页 共 13 页 学生简历管理系统 strcpy(pstor[4].storage_name,spec_name4 )。 strcpy(pstor[5].storage_name,spec_name5 )。 /* 负责人 */ strcpy(pstor[1].fuzeren_name,principal_name1 )。 strcpy(pstor[2].fuzeren_name,principal_name2 )。 strcpy(pstor[3].fuzeren_name,princi。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。