下载此文档

订餐系统c++代码.doc


文档分类:IT计算机 | 页数:约15页 举报非法文档有奖
1/15
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/15 下载此文档
文档列表 文档介绍
订餐系统代码
#include<iostream>
#include<fstream>
#include<iomanip>
#include<cstring>
using namespace std;
//菜单种类最大值
#define MAX 20
int static m=0;
int static i=0;
int static pass=0;
int compare(char *a,char *b)//比对用户名和密码
{for(int i=0;i<20;i++)
{if(*a++!=*b++)return 0;}
return 1;//完全匹配
}
//客户信息
struct Client {
char name[20];
char password[20];

};
//注册会员(存储客户信息)&&用户登入
void Register( )
{ Client user;
int n;
cout<<"您是否为会员?(0否 or 1是)"<<endl;
cin>>n;
if(n==0)
{ cout<<"**********用户注册模块***********"<<endl<<"请输入....."<<endl<<"注册用户名:";
ofstream client("");
if(!client){cout<<"用户信息打开失败!"<<endl;return;}
cin>>;
cout<<"注册密码:";
cin>>;
//保存用户信息
client<<'_'<<<<','<<<<endl;
cout<<"注册成功!"<<endl;
pass=1;
}
else{
cout<<"请输入....."<<endl;
cout<<"用户名:"; cin>>;
cout<<endl<<"密码:";cin>>;
ifstream guest("");
if(!guest){cout<<"!"<<endl;return;}

//比对输入的用户信息和已存储的用户信息
char name[20],password[20],ch;
int i=0,j=0;
while(guest>>ch&&j<20)
{

for( i=0;i<20;i++)
{if(ch==',')break;
if(ch=='_')guest>>ch;
name[i]=ch;
}


for(i=0;i<20;i++)
{if(ch=='_')break;
if(ch==',')guest>>ch;
password[i]=ch;
}

if((compare(,name)==1)&&(compare(,password)==1))
{cout<<"用户登入成功!"<<endl;pass=1;break;}

j++;

}

if(pass==0){cout<<"登录失败!!!!!请检查用户名和密码输入是否正确!"<<endl;}
}
}

void Convert( )//购物车,今日菜单
{ char cf,s[20];
int j=0,k=0;
int n;

ofstream out("");
if(!out){cout<<"!"<<endl;return ;}
ofstream Menu("");
if(!Menu){cout<<"!"<<endl;return ;}



订餐系统c++代码 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数15
  • 收藏数0 收藏
  • 顶次数0
  • 上传人gdntv68
  • 文件大小43 KB
  • 时间2020-11-10