服装销售管理系统(附源程序内容摘要:

谢意,在整个的设计过程中,很多老师、同学们都给予我们莫大的帮助。 我深知,只有不断的拼搏进取、不断的前进,才是对大家最好的感谢。 老师的严谨的工作作风、亲切的待人方式,渊博的专业知识都给我留下了深刻的印象,老师细心的讲解和指点使我从课程设计之中受益匪浅,使我从实际的算法实现中更好地掌握了理论知识。 她深 厚的理论水平都使我受益匪浅,无论在理论上还是在实践中,都给与我很大的帮助,使我得到不少的提高,这对于我以后的工作和学习都是一种巨大的帮助。 最后还要感谢我的同学们,感谢他们耐心的讲解和细心的指导,也感谢他们给我提出那么多的解决方案和指导性意见,帮我顺利完成我的课程设计和论文。 17 附录:源程序(带注释) include //包含文件读写 include include //包含 strcmp()字符是否相等 include //包含 system(cls)清屏 define MAX 20 //下列字符数组的大小 struct Date{//日期 char year[MAX]。 //年 char month[MAX]。 //月 char day[MAX]。 //日 }。 struct Goods{//物品信息 char name[MAX]。 //商品名称 char price[MAX]。 //商品价格 char number[MAX]。 //商品数量 char cost[MAX]。 //商品总价 char kind[MAX]。 //商品的种类 Date indate。 //购进日期 Goods * next。 //下一个结点 }。 class Cangkuguanli { //类定义与实现 private: int length。 //客户数量 Goods * head。 //列表的头结点 Goods * current。 //当前结点 public: Cangkuguanli()//构造函数 { head=new Goods。 //创建头结点 current=head。 currentnext=NULL。 length=0。 //长度为 0 } void Creatlist()//创建新的列表 { char g=39。 Y39。 int s=0。 length=0。 //初始长度为 0; current=head。 do { Goods * temp=new Goods。 //构建新结点信息 18 length++。 //每加一个结点 链表长度增 1 tempnext=NULL。 cout 请输入商品名称 :。 cintempname。 cout 请输入单价 :。 cintempprice。 cout 请输入商品数量 :。 cintempnumber。 cout 请输入总费用 :。 cintempcost。 cout 请输入日期 (**** ** **) :。 cintemptemptemp。 cout 请输入的种类 :。 cintempkind。 if(head==NULL){head=temp。 current=temp。 } //head 头指针, current 尾指针 else {currentnext=temp,current=temp。 } do{ cout next ? (Y N)。 //是否继续存入新产品 cing。 if(g!=39。 Y39。 amp。 amp。 g!=39。 N39。 ) { cout\n error !!!!\n。 } }while(g!=39。 Y39。 amp。 amp。 g!=39。 N39。 )。 }while(g==39。 Y39。 )。 //判断是否继续插入新结点 } void Open ()//打开一个数据文件,并建立链表关联 和文件中的记录对应 { char fname[20]。 //文件名称 cout input the name of the file \n。 cinfname。 //输入要打开的文件名 ifstream infile (fname)。 //创建输入文件流 infilelength。 cout\n length is: lengthendl。 //if(length==0)cout 数据为空 \n。 for(int i=0。 ilength。 i++)//创建新的结点保存文件的数据 { Goods * t=new Goods。 tnext=NULL。 infiletnametpricetnumbertcosttkind ttt。 if(head==NULL){head=t。 current=t。 }//跟上面的链表创建相似 19 else {currentnext=t,current=t。 } } ()。 //关闭文件流 }//open void Save ()//保存链表信息到文件 { if(length==0) { cout 列表为空 不需存盘 \n。 return。 } char fname[20]。 //文件名称 cout input the name of the file you want to put data in \n。 cinfname。 ofstream outfile(fname)。 //创建输出文件流 Goods * temp=headnext。 outfilelengthendl。 //先写入文件的长度 while (temp!=NULL)//把所有结点写入到文件 fname { outfiletempname tempprice tempnumber tempcost tempkind temp temp tempendl。 //写入每个结点信息 temp=tempnext。 } ()。 //关闭文件流 } void printinfor( Goods * current)//输出一个结点的信息到字符界面 { if(current==NULL) { cout\n 元素为空 !!! \n。 return。 } (39。 39。 )。 coutcurrentname。 (8)。 (8)。 coutcurrent。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。