购物卡管理系统(一)系统主要功能模块:(1)实现系统内制卡、发卡功能。(2)实现系统内购物卡帐户及相关帐户管理。(3)实现购物卡交易和合法性检查。(4)实现购物卡交易积分功能。(5)实现购物卡报表功能。(6)数据以文件形式存储。提示:制卡:指申请一个购物卡,但还没有使用。发卡:指该卡已经起用。实现卡交易:指从卡中消费掉一定金额。(二)题目及要求的分析:根据题目要求,系统应该实现以下功能:(1)制卡:主要是新建出一张购物卡,并输入了顾客部分信息,如姓名、密码等,但卡没有激活,依然不可使用。(2)发卡:激活新建的购物卡,用户能够使用卡进行各项活动。(3)消费:进入帐户后,取走少于帐户金额的钱款进行消费,并在帐户少减少相应的金额,增加相应的积分。(4)存款:进入帐户后,在金额项加上用户要存入的钱款。(5)报表:显示顾客购物卡上记录的所有信息,除密码外。(6)存储:购物卡内的信息以文件形式存储。(7)退出:从系统中退出。(8)菜单:提供良好的界面,方便用户的操作。代码:#include#include/*调用字符函数*/#include#include/*通用输入输出库*/#include#includeintflag=5;structcard{charname[20];charnumber[20];floatmoney;charkey[10];floatjifen;floatmid;intpower;structcard*next;};save(structcard*head);voidlist();voidjihuo();structcard*chaxun();save(structcard*head){FILE*fp;structcard*q;q=head;if((fp=fopen("e:\\123.txt","ab+"))==NULL){printf("无法打开\n");exit(0);}while(q!=NULL){if(fwrite(q,sizeof(structcard),1,fp)!=1){printf("文件写入错误!");fclose(fp);return(head);}q=q->next;}fclose(fp);}structcard*save1(structcard*head){FILE*fp;structcard*q;q=head;if((fp=fopen("e:\\123.txt","wb"))==NULL){printf("无法打开\n");exit(0);}while(q!=NULL){if(fwrite(q,sizeof(structcard),1,fp)!=1){printf("文件写入错误!");fclose(fp);return(head);}q=q->next;}fclose(fp);}structcard*duqu()//读取数据{structcard*head=NULL;structcard*p1,*p2;FILE*fp;if((fp=fopen("e:\\123.txt","rb+"))==NULL){printf("打开文件出错\n");exit(0);}while(!feof(fp)){if((p1=(structcard*)malloc(sizeof(structcard)))==NULL){printf("somethingiswrong!\n");fclose(fp);exit(0);}if(fread(p1,sizeof(structcard),1,fp)!=1){free(p1);break;}if(head==NULL)head=p2=p1;else{p2->next=p1;p2=p1;}}fclose(fp);return(head);}structcard*createlist(){structcard*head,*p,*q;inti;charnum[20];head=(structcard*)malloc(sizeof(structcard));head->next=NULL;head->money=0;head->jifen=0;system("cls");printf("\n\t\t********************注册购物卡*******************\n\n\n");do{printf("\n\n\t请输入要注册的卡号(六位数):");scanf("%s",head->number);if(strlen(head->number)!=6){system("cls");printf("\n\n\n\n\n\n\n\n\n\n\t\t\t对不起您的输入有误,请重新输入!\n\n");Sleep(1000);system("cls");printf("\n\t\t********************注册购物卡*******************\n\n\n");continue;}printf("\n\n\t请输入您的名字:");scanf("%s",head->name);printf("\n\n\t请输入您的密码:");scanf("%s",head->key);head->power=99;}while(strlen(head->number)!=6);p=head;system("cls");printf("\n\t\t********************注册购物卡*******************\n\n\n");printf("您的购物卡为:\n\n");printf("\n\t姓名卡号余额积分\n\n");printf("\t%2s%16s%13.2f%13.2f",p->name,p->number,p->money,p->jifen);getche();p->next=NULL;save(head);printf("\n\n\n\n\n\n\t\t\t");printf("购物卡注册成功!\n\n\n\n\t\t\t\t按任意键返回.....");getche();}voidcost(structcard*q){structcard*p,*a;p=duqu();a=p;while(strcmp(q->number,p->number)!=0){p=p->next;}system("cls");printf("\n\t\t********************账户消费*******************\n\n\n")...