ImageVerifierCode 换一换
格式:DOCX , 页数:14 ,大小:16.03KB ,
资源ID:9015595      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/9015595.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(productcpp.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

productcpp.docx

1、productcpp#include #include using namespace std;class student public:string place;int numble;string name;float price;int year;int month;int day;int quantity;student *next;student *head=NULL;void addgoods(student *head) /*增加商品功能*/student *p=head;string name;int o,j;cout请输入你想要提取商品的名字name;system(cls);i

2、f(head!=NULL)do p=head; head=head-next;while(p-name!=name);cout请输入存入的数量o;j=p-quantity;p-quantity=(j+o);void extract(student *head) /* 提取功能*/student *p=head;string name;int l,j;cout请输入你想要提取商品的名字name;system(cls);if(head!=NULL)do p=head; head=head-next;while(p-name!=name);cout 你想要提取的商品为: name 库存量为: qua

3、ntityendl;cout endl;cout请输入你想要提取的商品的数量l;if(l(p-quantity)cout .endl;cout endl;cout 库存不够endl;cout endl;cout 请重新输入你想提取的数量,请不要超过库存量endl;cout endl;cout 请注意库存量为 quantityendl;cout endl;cout .endl;cout请输入:l;cout 提取成功endl;cout quantity;p-quantity=(j-l);cout 库存剩余量为 quantityendl;elsecout 提取成功endl;cout quantity

4、;p-quantity=(p-quantity-l);cout 库存剩余量为 quantityendl; bool check(string str) /*判断输入*/for(int i=0;istr.length();i+)if(stri9)&(stri!=.)return false; return true;student *create()student *p1,*p2;p1=new student;head=p1;p2=p1;string str; cout请输入商品的编号str; while(!check(str) cout输入错误,请重新输入数字编号str; p1-numble=

5、atoi(str.c_str(); if(p1-numble!=0) cout请输入商品的名字:p1-name; cout请输入商品的价格str; while(!check(str) cout输入错误,请重新输入价格str; p1-price=atoi(str.c_str(); cout请输入要存入的数量str;while(!check(str) cout输入错误,请重新输入存入数量str; p1-quantity=atoi(str.c_str(); cout请输入商品的存储日期str; while(!check(str) cout输入错误,请重新输入年份str; p1-year=atoi(s

6、tr.c_str(); cinstr; while(!check(str) cout输入错误,请重新输入月份str; p1-month=atoi(str.c_str(); cinstr; while(!check(str) cout输入错误,请重新输入daystr; p1-day=atoi(str.c_str(); cout请输入商品的产地p1-place; system(cls); else delete p1,p2=NULL,p2-next=NULL,head=NULL; return head; while(p1-numble!=0) p2=p1; p1=new student; cou

7、t请输入商品的编号:endl;cout输入0代表退出存储功能str; while(!check(str) cout输入错误,请重新输入数字编号str; p1-numble=atoi(str.c_str(); if(p1-numble!=0) cout请输入商品的名字:p1-name; cout请输入商品的价格str; while(!check(str) cout输入错误,请重新输入价格str; p1-price=atoi(str.c_str(); cout请输入要存入的数量str; while(!check(str) cout输入错误,请重新输入存入数量str; p1-quantity=ato

8、i(str.c_str(); cout请输入商品的存储日期str; while(!check(str) cout输入错误,请重新输入年份str; p1-year=atoi(str.c_str(); cinstr; while(!check(str) cout输入错误,请重新输入月份str; p1-month=atoi(str.c_str(); cinstr; while(!check(str) cout输入错误,请重新输入daystr; p1-day=atoi(str.c_str(); cout请输入商品的产地p1-place; system(cls); p2-next=p1;delete p

9、1,p2-next=NULL;return head; void insert(student *head) int num=0; string name; student *p=NULL; student *l; p=new student; while(head) l=head; head=head-next; l-next=p; p-next=NULL; cout请输入插入的内容:endl; cout请输入商品的名字p-name; cout请输入商品的编号p-numble; cout请输入商品的价格p-price; coutp-quantity; cout请输入商品的存储日期p-year

10、; cinp-month; cinp-day; cout请输入商品的产地p-place; cout添加成功endl; cout endl; void deletenode(student *head) /*删除功能*/student *l=NULL; int num;cout请输入你想删除的编号num;if(head-numble=num)l=head;head=head-next;:head=head;delete l;return;while(head!=NULL) if(head-next=NULL) cout没找到要删除的编号endl;cout next-numble=num)l=he

11、ad-next;head-next=l-next;delete l;cout成功删除endl;cout next;void show(student *beginhead) /*显示功能*/student *p=beginhead;doif(beginhead!=NULL)cout 商品的编号为: numble 商品的名字为: nameendl;cout endl;cout 商品的价格为: price 商品的产地为: placeendl;cout endl;cout 商品的库存数量为: quantity 商品的存储日期为:year-month-dayendl;cout .endl;cout n

12、ext;elsecout此链表为空endl;delete p;while(p!=NULL);void search(student *head) /*查询*/int num;student *p;cout请输入你想查找的编号:num;while(head)if(head-next=NULL) cout没找到要查询的编号numble=num) p=head; cout商品的名字为; nameendl; cout商品编号为: numbleendl;cout商品的价格为: priceendl;cout商品的库存数量为: quantityendl;cout商品的存储日期为: year-month-da

13、yendl;cout商品的产地为: placenext; p=head;int main() /*系统入口主函数*/int i,k;cout 欢迎进入仓库管理系统endl;docout endl;cout endl;cout .endl;cout endl; cout 1代表存储商品基本信息.endl;cout endl;cout 2代表删除商品基本信息.endl;cout endl;cout 3代表显示所有商品信息.endl; cout endl; cout 4代表查询商品基本信息.endl;cout endl;cout 5代表添加商品基本信息.endl;cout endl;cout 6代表

14、提取商品.endl;cout endl;cout 7代表增加已有商品的存储量endl; cout endl; cout .endl;cout endl;cout i;system(cls);switch(i)case 1: head=create(); break;case 2: deletenode(head); break;case 3: show(head); break;case 4: search(head); break;case 5: insert(head); break;case 6: extract(head); break;case 7: addgoods(head); break;cout是否继续选择功能?endl;cout1代表是,0代表否endl;cout按1将自动跳转回功能选择界面k;system(cls);while(k!=0);return 0;

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

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