c语言银行账号姓名密码,求助啊,这个程序怎么改银行卡号密码

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

#include

#include

#include

class Card{

public:

Card(char a[10],int b,double c)

{

strcpy(num,a);

code=b;

money=c;

}

char num[10];

int code;

double money;

};

struct node

{

Card *cod;

node *next;

};

node *createlist(int n);//创建链表

node *findnum(char m[10],node *head);//核对卡号

int findcode(int q,node *head);//核对密码

void fetchmoney(node *head);//取款

void search(node *head);//查询余额

void zhuan(node *head,node *curnode);//转帐

void change_code(node *head);//更改密码

void exit();//退卡

void lock();//锁卡

void save(node *head);//保存信息

int main()

{

node *temp, *listhead=NULL;

int times=0;

listhead=createlist(2);

cout<

cout<

char p[10];

cin>>p;

temp=findnum(p,listhead);

if(temp)

{

while(times<3)

{

cout<

int q;

cin>>q;

if(findcode(q,temp)==0)

{

cout<

times++;

}

else

{

for(int i=0; ;i++)

{

cout<

cout<

cout<取款"<查询余额"<

cout<转帐"<更改密码"<

cout<退出"<

cout<

cout<

int r;

cin>>r;

if(r==1)

{

cout<

fetchmoney(temp);

save(listhead);

}

if(r==2)

{

cout<

search(temp);

save(listhead);

}

if(r==3)

{

cout<

zhuan(temp,listhead);

save(listhead);

}

if(r==4)

{

cout<

change_code(temp);

save(listhead);

}

if(r==5)

{

exit();

goto end;

}

}

}

}

if(times==3)

lock();

}

else

cout<

return 0;

end:

return 1;

}

node *createlist(int n)

{

node *temp, *tail=NULL, *head=NULL;

head=new node;

char x[10];

int y;

double z;

ifstream infile("outfile.txt",ios::in);

infile>>x>>y>>z;

if(head==NULL)

{

cout<

return NULL;

}

else

{

head->cod=new Card(x,y,z);

head->next=NULL;

tail=head;

}

for(int i=0;i

{

temp=new node;

char x[10];

int y;

double z;

if(temp==NULL)

{

cout<

return head;

}

else

{

while(!infile.eof())

infile>>x>>y>>z;

infile.close();

temp->next=NULL;

temp->cod=new Card(x,y,z);

tail->next=temp;

tail=temp;

}

}

return head;

}

node *findnum(char m[10],node *head)

{

while(head)

{

if((strcmp(head->cod->num,m))==0)

{

return head;

}

head=head->next;

}

return NULL;

}

int findcode(int q,node *head)

{

if(head->cod->code==q)

return 1;

}

void fetchmoney(node *head)

{

cout<

double s;

cin>>s;

if(head->cod->money<0)

cout<

if((head->cod->money)>s)

{

head->cod->money=(head->cod->money)-s;

cout<

}

else

{

cout<

}

}

void search(node *head)

{

cout<cod->money<

}

void zhuan(node *head,node *curnode)

{

cout<

char t[10];

cin>>t;

node *hold=findnum(t,curnode);

if(hold)

{

cout<

double d;

cin>>d;

if((head->cod->money)>d)

{

cout<

head->cod->money=(head->cod->money)-d;

hold->cod->money=(hold->cod->money)+d;

}

else

cout<

}

else

cout<

}

void change_code(node *head)

{

cout<

int e,f,g;

cin>>e;

if((head->cod->code)==e)

{

cout<

cin>>f;

cout<

cin>>g;

if(f==g)

{

(head->cod->code)=g;

cout<

}

else

cout<

}

else

cout<

}

void exit()

{

cout<

cout<

}

void lock()

{

cout<

}

void save(node *head)

{ ofstream outfile("outfile.txt",ios::out);

while(head)

{

outfile<cod->num<cod->code<cod->money<

head=head->next;

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
注:此银行管理系统是基于javase的课程设计,不是可视化的,是eclipse控制台的一个使用模式,包含和mysql数据库的交互,项目里面包含文档,数据库,ppt等等。 1、开户 开户时需要储户输入个人信息,包括姓名,开户金额,完成后储户信息被保存到一个储户基本信息文件中,并反馈给储户开户后的账,初始密码(提示信息尽快修长度为6位),开户金额,开户日期。同时生成一个操作记录包括账,操作类型,操作金额,本次操作的具体时间,旧密码,新密码 2、存款 存款时储户提供事先获得的账及存储的金额(现金),将金额加到账户原有金额中,然后返回本次操作的信息包括存储的金额,账中现有金额,操作时间。同时生成一个操作记录包括账,操作类型,操作金额,本次操作的具体时间,旧密码,新密码。 3、取款 取款时储户提供事先获得的账及要提取的金额(现金),将账中原有的金额减去要提取的金额,将现金交给储户,然后返回本次操作的信息包括提取的金额,账中现有的金额,操作时间。同时生成一个操作记录包括账,操作类型,操作金额,本次操作的具体时间,旧密码,新密码 4、转帐 转帐时储户提供事先获得转出账,转出账密码,转入账,转帐金额,将转出账中的金额减去转帐金额,转入账中的金额加上转帐金额,然后返回本次操作的信息包括转帐的金额,转出账现有的金额,本次操作的时间。同时生成一个操作记录包括账,操作类型,操作金额,本次操作的具体时间,旧密码,新密码 5、查询 查询时储户提供账密码。返回查询信息包括账,操作类型,操作金额,操作具体时间,旧密码,新密码 6、修密码密码时储户提供账密码,根据提示输入新密码两次(两次输入必须相同),完成后密码成功。同时生成一个操作记录包括账,操作类型,操作金额,本次操作的具体时间,旧密码,新密码 7、销户 销户时储户提供账密码,将账中的金额全部取出,然后将本账的信息从文件中删除,返回销户成功

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值