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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

用栈队列链表等实现的商品管理系统Word下载.docx

1、 Push a button to get a list displayed of all the items and their quantities in the inventory. 3. Push a button to take the next (top) item from inventory and put it in a shipping queue.4. Push a button to get a list displayed of all the items that are currently shipping.5. Push a button to indicate

2、 that a shipped item has been delivered and should be taken out of the shipping queue. Shipped items are put in and taken out FIFO.6. Push a button to display all the things that have been delivered.You are to create classes for the different data structures and nodes. You also need a driver program

3、 that takes user input and manipulates a node object and prints output. The driver should be written as a C+ application with buttons and text input and output.One way to do the application is to have two text fields for input, a text area for output, and buttons that say “add to inventory,” “displa

4、y inventory,” etc. Think about your design and draw it out before you write the code. Also, draw your data structures before you write any code. Draw out the operations of taking things from one data structure and putting them into another. Think about what goes in your application and your class be

5、fore you write any code.三、实验过程或算法(源程序)本组由王福临(20115394)、陈云艳(20115351)和许文丽(20115352)组成。许文丽负责课程设计的界面设计,以及最终的实验报告填写等总结部分,所进行的工作占总工作量的30%;陈云艳负责课程设计的几个基本类的具体功能的实现和出错处理部分,所进行的工作占总工作量的30%;王福临负责课程设计的界面设计内部的与功能相关的进货,出货以及卖货的综合函数的实现部分,所进行的工作占总工作量的40%。1:我们选用的是窗体应用程序来做这一个项目.2:许文丽同学设计的界面如下:整个实现一共有六个按钮,分别管理货物的入库,库存

6、货品的展示,货物的出库,出库货品的展示,货物的出售以及出售货物的展示。程序的主要进程如下:(1):用户点击按钮,把货物存入仓库;(2):点击按钮,展示所有仓库中的货物;(3):点击按钮,将货物的一部分从仓库中取出来;(4)展示所有的取出的货物;(5)将提出的货物一件件的卖出;(6)展示(记录)所有卖出的货物。3:类的具体功能的实现这些类的基本功能:为各个按钮的实现做基础,首先,我们需要用到类模板,那么就需要一个基类来作为我们的实例化对象;其次,对仓库中货物的操作其实本质上是对栈和队列中的数据元素的插入,删除的操作,所以首先要实现几个基本类的实现。node.h#pragma once#inclu

7、deusing namespace std;class node private: string h; int s; string d;public: node(void); void set(int a,string b,string c); node operator+(node&); bool operator=(node& int shu(); node(node &N) h=N.h; s=N.s; d=N.d; string huo(); string dan(); node(void);Node.cpp#include StdAfx.hnode.hnode:node(void) h

8、=; s=-1; d=void node:set(int a,string b,string c) s=a;h=b;d=c;string node:huo() return h;int node:shu() return s;dan() return d;node node:operator+(node&N) this-s=this-s+N.s; return *this;bool node:operator=(node& if (this-h=N.h)return 1;else return 0;node(void)Aquue.h#define Defaultsize 200template

9、 class Aquue int size; int front; int rear; T *listArray; Aquue(void) size=Defaultsize+1; rear=0; front=1; listArray=new Tsize; Aquue() delete listArray; void clear() front=rear; bool enqueue(const T &it) if (rear+2)%size=front) return false; rear=(rear+1)%size; listArrayrear=it; return true; bool d

10、equeue(T & if (length()=0)return false; it=listArrayfront; front=(front+1)%size; return true; bool frontValue(T & it)const if (length()=0) return false; virtual int length() const return (rear+size)-front+1)%size; ;Astack.h#define DefaultListSize 200templateclass Astack int top; Astack(void) size=De

11、faultListSize;top=0;listArray=new Tsize; Astack(Astack &sta) size=sta.size; top=sta.top; for(int i=0;i#includeAquue.hAstack.hForm2.h报馈?错洙?h出?啦?.hnamespace Project1 using namespace System; using namespace System:ComponentModel;Collections;Windows:Forms;Data;Drawing;Runtime:InteropServices; public ref

12、 class Form1 : public System:Forms:Form public: Form1(void) InitializeComponent(); a=new Aquue(); n=new Astack r=new Aquue protected: Form1() if(a) delete a; if(n) delete n; if (components) delete components; private: System:Button button1;TextBox textBox1;TextBox textBox2;Button button2;Label label

13、1;Label label2;TextBox textBox4;Label label3;RichTextBox richTextBox1;Label label4;Button button3;TextBox textBox3;TextBox textBox5;TextBox textBox6;Label label5;Label label6;Label label7;RichTextBox richTextBox2;Button button4;Label label8;Button button5;TextBox textBox7;TextBox textBox8;TextBox te

14、xtBox9;Label label9;Label label10;Label label11;Button button6;RichTextBox richTextBox3;Label label12; Aquue *a; Astack *n; AquueText).ToPointer(); string s1=ch1; Marshal:FreeHGlobal(IntPtr(void*)ch1); int flag=0; const char *ch2=(const char*)(Marshal:StringToHGlobalAnsi(textBox2- for(int i=0;ch2i!=

15、0 if(ch2i9|ch2iset1(please give the right messageShow(); return; else bbb=atoi(ch2);FreeHGlobal(IntPtr(void*)ch2); const char *ch3=(const char*)(Marshal:StringToHGlobalAnsi(textBox4- string s3=ch3;FreeHGlobal(IntPtr(void*)ch3); node no; no.set(bbb,s1,s3); n-push(no); textBox1-Text=L textBox2- textBo

16、x4-(2)库存显示:由于进货入库是一个一对一的操作,如果用户不记得自己到底进了那些货,多少货,那么只需要点击“仓库货物展示”按钮就可以看到仓库中所有的有序排列的货物。如下所示:其实就是将上一入库中所接受的货物从栈中pop出来,但值得注意的是不能对栈本身操作,而是要将其复制,这样才不会使得原来栈中元素全无,再者就是不会导致每点击一次库存展示它的顺序就颠倒一次,这样显然不符合我们用栈的初衷,所以才需要用到拷贝构造函数对其复制品进行操作。Void button2_Click(System: node it; Astack *d; d=new Astackpop(it) int aa,bb; str

17、ing name= string sss= string danwei= name=it.huo(); aa=it.shu(); danwei=it.dan(); while(aa) bb=aa%10; aa=aa/10; sss=char(bb+48)+sss; st=st+name+ +sss+danwei+n String ss=gcnew String(st.c_str(); richTextBox1-Text=ss; delete ss; delete d;(3)出库:a.现在要提货了,即本质上是从栈中拿货,这样就是对栈的一些操作了,注意我们这里并没有将不同时间进来的相同的货物数量加在一起,为了保持栈的本质不变,所以提货的时候也要保持原来货物的顺序不改变,只是将货物的数量减少而已,调试结果如下所示:(提货前)(提货后)B.另外,还必须考虑的一个问题是,万一我事先不知道或者不是进货本人来提货的时候,可能会出现所提的货不在仓库之中,因此我们需要为其提供一个报错框,来提示用户仓库中无此货,如下所示:C.那么,如果库存商品没有我们想要的那么多呢,这是有需要进行报错处理,如下;Void button3_Click(System: int am; const char *ch=(const char

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

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