会员卡计费系统c 课程设计报告

上传人:飞*** 文档编号:28645077 上传时间:2018-01-18 格式:DOC 页数:66 大小:835KB
返回 下载 相关 举报
会员卡计费系统c  课程设计报告_第1页
第1页 / 共66页
会员卡计费系统c  课程设计报告_第2页
第2页 / 共66页
会员卡计费系统c  课程设计报告_第3页
第3页 / 共66页
会员卡计费系统c  课程设计报告_第4页
第4页 / 共66页
会员卡计费系统c  课程设计报告_第5页
第5页 / 共66页
点击查看更多>>
资源描述

《会员卡计费系统c 课程设计报告》由会员分享,可在线阅读,更多相关《会员卡计费系统c 课程设计报告(66页珍藏版)》请在金锄头文库上搜索。

1、附件 1:学 号: 课 程 设 计题 目 会员卡计费系统学 院 计算机科学与信息工程学院专 业 计算机科学与技术班 级 计算机学生姓名指导教师2015 年 12 月 29 日 重庆工商大学课程设计成绩评定表学院:计信学院 班级:计算机 3 班 学生姓名 学号:优秀(100x90)良好(90x80)中等(80x70)及格(70x60)不及格(xname1cardID1ID1balance1;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(!strcmp(cardID1,p-cardID)coutID)coutnextp=nextp;nextp=q1;strcpy

2、(q1-name,name1);strcpy(q1-cardID,cardID1);strcpy(q1-ID,ID1);q1-balance=balance1;SYSTEMTIME m_time;GetLocalTime(q1-t.year=m_time.wYear;q1-t.mouth=m_time.wMonth;q1-t.day=m_time.wDay;s3:coutn;if(n=2)break;else if(n!=1)couta;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(!strcmp(a,p-cardID)break;if(p=NULL)cou

3、tm;switch(m)case 1:coutb;strcpy(p-cardID,b);break;case 2:coutb;strcpy(p-name,b);break;case 3:coutb;strcpy(p-ID,b);break;default:couta;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(!strcmp(a,p-cardID)break;if(p=NULL)couta;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(!strcmp(a,p-cardID)break;if(p=NULL)coutm;if

4、(m=1)cardDelete(a);else if(m=2)couta;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(!strcmp(a,p-cardID)break;if(p=NULL)couta;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(!strcmp(a,p-name)break;if(p=NULL)couta;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(strstr(p-name,a)break;if(p=NULL)couta;card *p;for(p=nextp;p!

5、=NULL;p=p-nextp)if(!strcmp(a,p-ID)break;if(p=NULL)coutnextp!=NULL&this-nextp-nextp!=NULL)p1=this;p2=this-nextp;p3=p2-nextp;p2-nextp=NULL;while(p3!=NULL)p4=p3-nextp;while(p2!=NULL&strcmp(p3-cardID,p2-cardID)0)p1=p2;p2=p2-nextp;p1-nextp=p3;p3-nextp=p2;p1=this;p2=this-nextp;p3=p4;elsereturn;void card:i

6、nsertSortTotal()/插入排序消费总额card *p1;card *p2;card *p3;card *p4;if(this-nextp!=NULL&this-nextp-nextp!=NULL)p1=this;p2=this-nextp;p3=p2-nextp;p2-nextp=NULL;while(p3!=NULL)p4=p3-nextp;while(p2!=NULL&p3-totaltotal)p1=p2;p2=p2-nextp;p1-nextp=p3;p3-nextp=p2;p1=this;p2=this-nextp;p3=p4;elsereturn;六显示会员卡void

7、card:show()/会员卡全部显示函数coutnextp)coutcardIDnameIDt.yeart.moutht.daybalancetotalga;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(!strcmp(a,p-cardID)break;if(p=NULL)coutmoney;s7:coutm;if(m=1)p-balance+=money;couta;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(!strcmp(a,p-cardID)break;if(p=NULL)coutthingsmoneynum;

8、if(p-balance+p-total)1000)money=money*0.9;if(p-g=1)coutbalance-num*moneynext=p-q-next;p-q-next=q2;strcpy(q2-things,things);q2-num=num;q2-money=money;p-balance=p-balance-num*money;p-n+;p-total=p-total+num*money;SYSTEMTIME m_time;GetLocalTime(q2-t1.year=m_time.wYear;q2-t1.mouth=m_time.wMonth;q2-t1.day

9、=m_time.wDay;couta;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(!strcmp(a,p-cardID)break;if(p=NULL)coutm;if(m=1)p-g=1;couta;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(!strcmp(a,p-cardID)break;if(p=NULL)coutm;if(m=1)p-g=0;couta;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(!strcmp(a,p-cardID)break;if(p=NULL)cou

10、ta;for(q1=nextp;q1!=NULL;q1=p-nextp)if(!strcmp(a,q1-cardID)coutcardID,a);十消费查询函数void card:showBuy()/显示购买函数char a9;buy *q1;s6:couta;card *p;for(p=nextp;p!=NULL;p=p-nextp)if(!strcmp(a,p-cardID)break;if(p=NULL)coutq;coutnext;q1!=NULL;q1=q1-next)coutthingsmoneynumt.yeart.moutht.daynextp=nextp;nextp=p;fs

11、canf(fp,%s,fscanf(fp,%s,fscanf(fp,%d,fscanf(fp,%d,fscanf(fp,%d,fscanf(fp,%s,fscanf(fp,%d,fscanf(fp,%d,fscanf(fp,%d,fgetc(fp);fscanf(fp,%d,p-q=new buy;p-q-next=NULL;for(int i=0;p-ni;i+)buy *p2;p2=new buy;p2-next=p-q-next;p-q-next=p2;fscanf(fp,%d,fscanf(fp,%d,fscanf(fp,%d,fscanf(fp,%s,fscanf(fp,%d,fsc

12、anf(fp,%d,while(fgetc(fp)!=EOF);fclose(fp);coutnextp)if(p-nextp=NULL)fprintf(fp,%s ,p-name);fprintf(fp,%s ,p-cardID);fprintf(fp,%d ,p-t.year);fprintf(fp,%d ,p-t.mouth);fprintf(fp,%d ,p-t.day);fprintf(fp,%s ,p-ID);fprintf(fp,%d ,p-balance);fprintf(fp,%d ,p-g);fprintf(fp,%dn,p-total);if(p-n0)fprintf(f

13、p,%dn,p-n);elsefprintf(fp,%d,p-n);if(p-n0)buy *q1;for(q1=p-q-next;q1!=NULL;q1=q1-next)fprintf(fp,%d ,q1-t1.year);fprintf(fp,%d ,q1-t1.mouth);fprintf(fp,%d ,q1-t1.day);fprintf(fp,%s ,q1-things);fprintf(fp,%d ,q1-money);if(q1-next=NULL)fprintf(fp,%d,q1-num);elsefprintf(fp,%dn,q1-num);elsefprintf(fp,%s

14、 ,p-name);fprintf(fp,%s ,p-cardID);fprintf(fp,%d ,p-t.year);fprintf(fp,%d ,p-t.mouth);fprintf(fp,%d ,p-t.day);fprintf(fp,%s ,p-ID);fprintf(fp,%d ,p-balance);fprintf(fp,%d ,p-g);fprintf(fp,%dn,p-total);fprintf(fp,%dn,p-n);if(p-n0)buy *q1;for(q1=p-q-next;q1!=NULL;q1=q1-next)fprintf(fp,%d ,q1-t1.year);fprintf(fp,%d ,q1-t1.mouth);fprintf(fp,%d ,q1-t1.day);fprintf(fp,%s ,q1-things);fprintf(fp,%d ,q1-money);fprintf(fp,%dn,q1-num);fclose(fp);coutusename1;s2:coutpassword1;for(i=0;i#include #include#includeclass.h#includewindows.husing namespace std;card:card()/无参数构造函数strcpy(

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号