银行帐户管理程序功能完善版Word下载.docx

上传人:b****6 文档编号:21583434 上传时间:2023-01-31 格式:DOCX 页数:22 大小:18.93KB
下载 相关 举报
银行帐户管理程序功能完善版Word下载.docx_第1页
第1页 / 共22页
银行帐户管理程序功能完善版Word下载.docx_第2页
第2页 / 共22页
银行帐户管理程序功能完善版Word下载.docx_第3页
第3页 / 共22页
银行帐户管理程序功能完善版Word下载.docx_第4页
第4页 / 共22页
银行帐户管理程序功能完善版Word下载.docx_第5页
第5页 / 共22页
点击查看更多>>
下载资源
资源描述

银行帐户管理程序功能完善版Word下载.docx

《银行帐户管理程序功能完善版Word下载.docx》由会员分享,可在线阅读,更多相关《银行帐户管理程序功能完善版Word下载.docx(22页珍藏版)》请在冰豆网上搜索。

银行帐户管理程序功能完善版Word下载.docx

chartmp[100],intquqian,chartmp1[100],intzhuanzhang,chartmp2[100])

{

ID=id;

name=Name;

money=m;

passwd=PassWord;

idc=idcard;

pho=phone;

cq=cunqian;

qq=quqian;

zz=zhuanzhang;

strcpy_s(TMP,tmp);

strcpy_s(TMP1,tmp);

strcpy_s(TMP2,tmp);

}

consumer()

{ID=0;

name='

0'

;

money=0;

passwd='

idc=0;

pho=0;

cq=0;

strcpy_s(TMP,"

0"

);

qq=0;

strcpy_s(TMP1,"

zz=0;

strcpy_s(TMP2,"

}//构造函数初始化

intget_id()

{returnID;

}

intget_idcard()

{returnidc;

intget_phone()

{returnpho;

voidsavemoney();

//存钱

stringget_passwd(){returnpasswd;

}//取得密码

voiddisplay();

//个人信息界面

voiddisplay1();

//查询记录界面

voiddisplay2();

voiddisplay3();

voiddisplay4();

voidfetchmoney();

//取钱

voidchange_passwd();

voidadd_money(float);

voiddec_money(float);

floatget_money();

//卡卡转帐

private:

intID;

//开户帐号

stringpasswd;

//用户密码

stringname;

//用户姓名

floatmoney;

//开户金额

intidc;

intpho;

charTMP[100],TMP1[100],TMP2[100];

intcq,qq,zz;

voidYH:

:

save()

{ofstreamofile("

bankdat.dat"

ios:

out);

ofstreamoutfile("

intn=0;

outfile<

<

acnum<

"

"

for(n=0;

n<

acnum;

n++)

{outfile<

account[n]->

ID<

endl;

money<

name<

passwd<

idc<

pho<

cq<

qq<

zz<

TMP<

TMP1<

TMP2<

outfile.close();

/*读入用户信息功能实现*/

load()

{ifstreaminfile("

in);

if(!

infile)

{cerr<

读取错误,无资料中!

return;

intid,cunqian,quqian,zhuanzhang;

intm,idcard,phone;

chartmp[100],tmp1[100],tmp2[100];

stringnam,passw;

infile>

>

{infile>

id;

m;

nam;

passw;

idcard;

phone;

cunqian;

quqian;

zhuanzhang;

tmp;

tmp1;

tmp2;

passwd;

consumer*acc=newconsumer(id,nam,passw,m,idcard,phone,cunqian,tmp,quqian,tmp1,zhuanzhang,tmp2);

account[n]=acc;

infile.close();

cout<

读取资料正常!

 

/*转账功能实现*/

transfer(intx)

{intid;

请输入帐号:

cin>

intflag=1;

inti=0;

while((i<

acnum)&

&

(flag))

{

if(id==account[i]->

get_id())flag=0;

elsei++;

}

if(flag)

帐号不存在!

endl<

return;

floatb;

cout<

请输入你要转帐的金额:

cin>

b;

while(b<

=0)

请输入正确的数字!

→"

if(account[x]->

get_money()<

b)cout<

对不起,金额不够!

!

else{account[x]->

dec_money(b);

account[i]->

add_money(b);

account[x]->

zz=b;

time_tt3=time(0);

//time_t是结构体,包含在time.h中,

strftime(account[x]->

TMP2,sizeof(account[x]->

TMP2),"

%Y/%m/%d%X%A"

localtime(&

t3));

size_tstrftime(char*strDest,size_tmaxsize,constchar*format,conststructtm*timeptr);

转账成功!

}

for(intj=0;

j<

=1000000000;

j++){};

//延时功能

/*账户金额计算*/

voidconsumer:

add_money(floatx)

{money=x+money;

dec_money(floatx)

{money=money-x;

addmoney(intx,floaty)

{account[x]->

money=account[x]->

money-y;

floatconsumer:

get_money()

{returnmoney;

voidmain()

{YHyh;

consumerc1;

yh.functionshow();

/*主界面显示*/

functionshow()

doublen;

intt;

do

{system("

cls"

load();

请输入相应的操作序号进行操作:

*********************************************************"

1.账户注册"

2.账户登录"

3.账户注销"

4.退出系统"

n;

while(n<

1||n>

4)

{

操作错误,请输入正确的操作序号!

while

(1)

if(n-(int)n==0)

{t=n;

break;

else{cout<

cin>

switch(t)

case1:

set_account();

//开户

break;

case2:

enter_account();

//登录

break;

case3:

del_account();

//注销

case4:

exitYH();

//退出

cin.get();

//接收输入一行字符串

while(true);

enter_account()//登陆账号

//__page_break__

请输入密码:

stringpassw;

if(passw!

=account[i]->

get_passwd())

{cout<

密码错误,请重新操作!

for(intj=0;

display();

cin.get();

doublen;

intt,r;

do{system("

请选择下列操作:

**************************************************"

1.查看账户信息"

2.取款"

3.存款"

4.修改密码"

5.转账"

6.查询存取款转账记录"

7.返回上一菜单"

7)

switch(t)

{case1:

account[i]->

case2:

fetchmoney();

save();

case3:

savemoney();

case4:

change_passwd();

case5:

transfer(i);

case6:

display1();

{cin>

r;

switch(r)

display2();

display3();

display4();

}break;

case7:

}cin.get();

while

(1);

set_account()//开户

intid,cunqian,quqian,zhuanzhang;

chartmp[100],tmp1[100],tmp2[100];

stringnam;

stringpassw;

floatm;

intidcard,phone;

intflag=1;

inti=0;

cout<

请输入数字账户号:

while((i<

{

if(id==account[i]->

get_id())

flag=0;

cout<

该帐号已存在,请重新输入!

for(intj=0;

return;

}

else

{i++;

请输入开户人姓名:

请输入开户密码:

请输入存入金额:

while(m<

请输入身份证号:

请输入电话号码:

cunqian=0;

time_tt1=time(0);

//time_t是结构体,包含在time.h中,

strftime(tmp,sizeof(tmp),"

t1));

quqian=0;

time_tt2=time(0);

strftime(tmp1,sizeof(tmp1),"

t2));

zhuanzhang=0;

time_tt3=time(0);

strftime(tmp2,sizeof(tmp2),"

account[acnum]=acc;

开户成功!

acnum++;

del_account()//账号注销

intid;

请输入你要注销的帐户号:

if(id==account[i]->

flag=0;

else

i++;

该帐号不存在,请重新操作!

密码或账号错误,请重新操作!

for(intj=i;

j++)

account[j]=account[j+1];

account[acnum-1]=NULL;

acnum--;

你的账号已注销!

change_passwd()//修改密码

stringpwd,repwd;

请输入新密码:

pwd;

请再输入一次新密码:

repwd;

if(pwd!

=repwd)

你输入的两次密码不一样,按输入键返回上一层菜单!

else

密码修改成功,请牢记!

passwd=repwd;

fetchmoney()//取钱函数

floatm;

charch;

输入取款金额:

¥>

endl;

if(money<

m)

对不起,你的余额不足!

else

{money=money-m;

qq=m;

strftime(TMP1,sizeof(TMP1),"

操作成功,请收好钱!

是否要继续该项操作:

(Y/N)"

ch;

while(ch!

='

n'

ch!

N'

Y'

y'

)//选择错误时判定

}while(ch=='

||ch=='

savemoney()//存钱函数功能实现

char

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > PPT模板 > 简洁抽象

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1