最新c++超市购物系统.doc
《最新c++超市购物系统.doc》由会员分享,可在线阅读,更多相关《最新c++超市购物系统.doc(42页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Four short words sum up what has lifted most successful individuals above the crowd: a little bit more.-author-datec+超市购物系统c+超市购物系统#include<iostream.h>#include<string.h>#include <windows.h>#include<stdlib.h>#include "stdio.h "#include "conio.h "#include<
2、;vector>using std:vector;using namespace std;int clrscr();void doit();void lock();class cust;void passwordInput(char *password);class marketpublic:market(cust& cn):cnsm(cn)bool check(char Number,char Pwd);void change();void getmoney();void savemoney();void fun();void inf();void exitm();privat
3、e:int n;cust&cnsm;class custpublic:friend class market;cust(char Name,char Num,float Money,char Password);char*get_name();char*get_number();char*get_pwd();float get_money();void set_pwd(char Pwd);void get(float m);void save(float m);private:char name20;char number20;float money;char pwd8;cust:cu
4、st(char Name,char Num,float Money,char Password)strcpy(name,Name);strcpy(number,Num);money=Money;strcpy(pwd,Password);char *cust:get_name()return name;char*cust:get_number()return number;float cust:get_money()return money;char*cust:get_pwd()return pwd;void cust:set_pwd(char Pwd)strcpy(pwd,Pwd);void
5、cust:get(float m)money-=m;void cust:save(float m)money+=m;bool market:check(char Number,char Pwd)if(strcmp(Number,cnsm.get_number()=0&&strcmp(Pwd,cnsm.get_pwd()=0)return true;elsereturn false;void market:change()char pwd8,repwd8;n=0;doprintf("n");passwordInput(pwd);pwd6='0'
6、if(!check(cnsm.get_number(),pwd)n+;elsebreak;while(n<3);if(n=3)lock();int t=0;doprintf("n");passwordInput(pwd);pwd6='0'printf("n");passwordInput(repwd);repwd6='0'if(t=strcmp(pwd,repwd)!=0)cout<<"!"<<endl;while(t!=0);cnsm.set_pwd(pwd);cout&
7、lt;<"!"<<endl;void market:getmoney()char m;cout<<"13.5"<<"9.5"<<endl<<" y&n"<<endl;cin>>m;doit();if(cnsm.get_money()-13.5*0.95<0)cout<<"!"<<endl;elseif(m='y')cout<<endl<
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 最新 c+ 超市 购物 系统
限制150内