C语言客户VIP管理系统,路西牌会员管理系统。

C语言客户VIP管理系统,路西牌会员管理系统。该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 void VIP show Node v no v char a VIP sex v std cout lt lt lt 会员姓名 lt lt node item num 1 lt lt endl lt lt

大家好,我是讯享网,很高兴认识大家。

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

void VIP::show( Node *v)

{

no(v);

char *a=VIP::sex(v);

std::cout<

<< "会员姓名: "<< node.item.num[1]<< endl

<< "性别: "<< sex(v)<

<< "手机号码: "<< node.item.num[2]<< endl

<< "储值账户: "<< node.item.mony<< endl

<< "积分账户: "<< node.item.gra<< endl<

}

VIP::Node * VIP::Find(int i)

{

int a=0;

char n[11];

char *ite;

switch(i){

case 0:ite="卡号:";break;

case 1:ite="姓名:";break;

case 2:ite="手机号码:";break;}

cout<

cin.getline(n,10);

Node *temp=head;

while(temp!=NULL)

{

if(strstr(temp->item.num[i],n)!=NULL)

{

show(temp);

a++;

temp=temp->next;

continue;

}

else if(temp->next==NULL&&a==0)

{

cout<< "没有这个会员,重新输入(q 退出):"<< endl;

cin.getline(n,10);

if(!strcmp(n,"q"))

break;

temp=head;

continue;

}

temp=temp->next;

}

return NULL;

}

void VIP::Save()

{

if(!Items())

{

cout<< "没有会员..太失败了.."<< endl;

return ;

}

Node *v=InTheVIP();

if(v!=NULL)

{

int i;

cout<< "请输入要储存的金额:\n";

cin>> i;

while(getchar()!='\n');

v->item.mony += i;

show(v);

}

}

void VIP::Con()

{

if(!Items())

{

cout<< "没有会员..太失败了.."<< endl;

return ;

}

Node *v=InTheVIP();

if(v==NULL)return;

int i;

cout<< "请输入要消费的金额:\n";

while(cin>> i&& i!=0)

{

while(getchar()!='\n');

if(i<=v->item.mony)

{

cout<< "请输入密码:";

char n[10];

while(cin >>n&&strcmp(v->item.num[3],n))

{

if(strcmp(n,"q"))

return;

cout<< "输入错误,请重新输入(q退出)";


讯享网

}

v->item.mony -= i;

v->item.gra += i;

cout<< "扣款成功"<

show(v);

break;

}

else

cout<< "余额不足,请重新输入(0 退出)"<

}

}

void VIP::showall()

{

if(!Items())

{

cout<< "没有会员.太失败了.."<< endl;

return;

}

printf("%-15s%-10s%-15s%-15s%-15s\n", "会员卡号", "姓名", "手机号码", "储值账户", "积分账户");

for(Node *temp=head;temp!=NULL;temp=temp->next)

{

printf("%-15s%-10s%-15s%-15.1f%-15.1f\n",

temp->item.num[0]

,temp->item.num[1]

,temp->item.num[2]

,temp->item.mony

,temp->item.gra);

}

}

char* VIP::sex(const VIP::Node *v)

{

return v->item.morw==1?"Man":"Woman";

}

bool VIP::Err(char *n)

{

Node *temp=head;

while(temp!=NULL)

{

if(!strcmp(temp->item.num[0],n))

{

cout<< "该会员卡号已存在,请重新输入"<

return true;

}

else temp=temp->next;

}

return false;

}

VIP::Node * VIP::InTheVIP()

{

char n[11];

cout<

cin.getline(n,10);

Node *temp=head;

while(temp!=NULL)

{

if(strcmp(temp->item.num[0],n)==0)

{

show(temp);

return temp;

}

else if(temp->next==NULL)

{

cout<< "没有这个会员,重新输入或在查询会员资料处进行模糊查找(q 退出):"<< endl;

cin.getline(n,10);

if(!strcmp(n,"q"))

break;

temp=head;

continue;

}

temp=temp->next;

}

return NULL;

}

bool VIP::ToTheFile(FILE *pf)

{

int i;

Node* temp=head;

fseek(pf,0L,SEEK_SET);

for( i=0;i

{

fseek(pf,i*sizeof(Item),SEEK_SET);

fwrite(&temp->item,sizeof(Item),1,pf);

temp=temp->next;

}

return true;

}

小讯
上一篇 2025-01-14 21:41
下一篇 2025-01-19 20:04

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/81950.html