银行储蓄管理系统.docx
《银行储蓄管理系统.docx》由会员分享,可在线阅读,更多相关《银行储蓄管理系统.docx(19页珍藏版)》请在冰豆网上搜索。
银行储蓄管理系统
仲恺农业工程学院
课程设计报告
****************************
课程面向对象课程设计
姓名钟子豪
院(系)信息科学与技术学院
专业年级计算机科学与技术145班
学号************
指导教师郑建华
日期
仲恺农业工程学院教务处制
一.需求与功能分析
随着社会经济的发展,信息化程度的不断深入,银行的传统业务己愈来愈不能满足银行客户的需要。
现今,人们的金融意识、科技意识己经有了很大的提高,在紧张忙碌的生活中,己越来越来不习惯每月奔忙于各银行营业柜台之问去排队缴各种各样的费用了;同时,各种经营单位如电信、移动、供电、煤气、自来水、证券等等一是为了提高服务质量、方便客户,二是为了减轻自己日趋繁重的工作量,纷纷委托银行为其开展代收代付业务:
同时,随着我国加入世贸组织的日益临近,我国的银行业将面临更加激烈的同业竞争,如何提供更多的金融产品和更优质的服务,如何吸引更多的客户,如何利用计算机技术加强银行帐户信息管理、进行银行业务再造,提高银行的工作效率和业务竟争能力是摆在各家银行面前的一个迫切需要解诀的问题。
近几年来,各商业银行加快了与社会各业的合作,利用自身的网点优势和业务特点,为其提供各种高效、快捷的代收代付业务,也就是中间代理业务,目前以与广大人民群众生活密切相关的各项缴费业务如水电费、电话费、手机费等代收业务为主,这些业务开展方式多种多样,但一般都离不开计算机的高效管理支持。
随着代理业务不断发展,业务品种越来越多,各项业务做法互有差异,这就对银行的电子化水平和相应的管理水平提出了更高的要求。
如何利用电子化的手段构建一个高效统一的、通用灵活的系统来管理各种各样的业务,是每个商业银行所要研究的课题。
支持决策系统的,需要在数据库的基础上,进行联机分析处理,每次处理的数据量大,响应时间长。
特别是银行每天要处理大量的存取款事件,做好存取款是银行工作重要的环节,然而要有效处理必须要有良好的程序和数据管理系统来建立一个良好的软件系统来实现快速、有效、准确、安全的处理银行事物。
主要用于银行的储蓄卡管理系统,它可以帮助我们有效、准确、并且高效实现的完成存取事件。
此系统操作方便效率、安全性高,只要客户开户并设定好密码就可以轻松的实现存取款。
系统实现的主要有储蓄卡开户管理、存取款管理、用户查询历史数据显示、注销等功能。
储蓄卡开户管理模块:
卡号、姓名、开户金额、身份证号、地址、电话、密码、确认密码和保存组成。
(开户金额必须是数字,密码和确认密码必须一样是六位数字)
*查询历史数据模块:
存款记录、取款记录、余额显示等。
*注销模块:
一旦注销该卡号就不存在且余额提醒你取出。
通过该银行账户管理系统地运行,使办公人员可以轻松快捷的完成对账户管理的任务,提高账目管理效率,使银行的账目管理工作系统化、规范化、自动化。
该银行帐目管理信息系统,优点是设计过程思路清晰、模块划分简洁,设计各阶段分工明确。
经过实践证明,该划分是合理的,极大得提高了本系统的实现。
二.设计内容
(一)管理员模式
1、开户,管理员输入用户姓名、身份证号码;用户输入密码、确认密码。
2、挂失,管理员输入用户卡号进行操作。
3、取消挂失,同上。
4、消户,管理员输入用户帐号,密码,显示用户信息,确认后进行操作。
(二)用户模式
1、存款,用户输入帐号,密码,存款金额进行操作。
2、取款,同上。
3、查询,输入密码。
4、转账,输入本人密码,对方账号,转账金额进行此操作。
5、更改密码,输入原密码,再输入新密码,然后确认新密码。
三.课程设计工作计划
1、确定题目,做用户需求分析
2、查阅资料,进行问题分析,制定方案
3、根据方案编写程序并进行调试
4、撰写设计说明书,完成设计
5、提交设计内容,答辩
四.系统模块
本系统包括管理员模式其中包括:
开户、挂失、取消挂失、消户功能;用户模式其中包括:
存款、取款、查询、转账、更改密码功能,如图1所示
图1银行账户管理系统模块
1、管理员模式:
此模式用于银行管理员为用户开户使用户获取账号,凭用户获取的账号银行管理员可为用户提供挂失,解除挂失销户的服务。
2、用户模式:
此模式用于用户在银行中存款,取款,查询自己在银行账户中的余额,还提供转账功能,为用户带来便利,修改密码使用户可以随时更改自己账户的密码,使得账户安全。
五.程序调试
程序调试:
六.程序设计分析
源代码:
#include
#include
#include
#include
#include
intcode();//登录密码
usingnamespacestd;
classconsumer;
classYH
{
public:
YH();
voidset_account();
//银行开户
voiddel_account();
voidtransfer(int);//转账
voidenter_account();
voidaddmoney(int,float);
voidexitYH();//退出系统
voidfunctionshow();
voidsave();
voidload();//功能界面
protected:
consumer*account[20];
staticintacnum;
//账户数
};
//登录密码
intcode()
{
inti=0,j=0;
intc;
charname[15],cod[15];
cout<<"\n\n";
while(j<3)
{
cout<<"\t\t管理员:
";
cin.getline(name,sizeof(name));//用cin不包括空格符;
cout<";
j++;
c=getch();
while(c!
='\r')//回车
{
if(i>=0)
{
if(c=='\b')
{
cout<<"\b\b";
i=i-1;
}
else
{
cout<<"*";
cod[i]=c;
}
}
c=getch();
if(c!
='\b')
i=i+1;
}
cod[i]='\0';
cout<if((strcmp(name,"6539")==0)&&(strcmp(cod,"li")==0)
||(strcmp(name,"2")==0)&&(strcmp(cod,"222")==0))
{
cout<<"登陆成功!
\n\n";j=4;break;
}
else
{
if((strcmp(name,"***")!
=0)||(strcmp(name,"***")!
=0))
cout<<"登陆失败!
密码错误\n\n";
elsecout<<"登陆失败!
管理员不存在\n\n";
}
}
returnj;
}
intYH:
:
acnum=0;
YH:
:
YH()
{
for(inti=0;i<20;i++)
{
account[i]=NULL;
}
}
classconsumer:
publicYH
{
public:
friendclassYH;
consumer(intid,stringName,stringPassWord,floatm)
{
ID=id;name=Name;money=m;passwd=PassWord;
}
consumer()
{ID=0;name='0';money=0;passwd='0';}
intget_id(){returnID;}
voidsavemoney();
//存钱
stringget_passwd()
{returnpasswd;}
//取得密码
voiddisplay();
voidfetchmoney();//取钱
voidchange_passwd();
voidadd_money(float);
voiddec_money(float);
floatget_money();
//卡卡转帐
private:
intID;//开户帐号
stringpasswd;//用户密码
stringname;//用户姓名
floatmoney;
};
voidYH:
:
save()
{ofstreamofile("bankdat.txt",ios:
:
out);
ofstreamoutfile("bankdat.txt",ios:
:
out);
intn=0;
outfile<for(;n{outfile<ID<<"";
outfile<money<<"";
outfile<name<<"";
outfile<passwd<<"";
}
outfile.close();//__page_break__
}
voidYH:
:
load()
{ifstreaminfile("bankdat.txt",ios:
:
in);
if(!
infile)
{cerr<<"读取错误,无资料中!
"<return;
}
intn=0;
intid,m;
stringnam,passw;
infile>>acnum;
for(;n{infile>>id;
infile>>m;
infile>>nam;
infile>>passw;
account[n]->passwd;
consumer*acc=newconsumer(id,nam,passw,m);
account[n]=acc;
}
infile.close();
cout<<"读取资料正常!
"<}
voidYH:
:
transfer(intx)
{intid;
cout<<"请输入帐号:
";
cin>>id;
intflag=1;
inti=0;
while((i{
if(id==account[i]->get_id())flag=0;
elsei++;
}
if(flag)
{
cout<<"帐号不存在!
"<return;
}
floatb;
cout<";
cin>>b;
while(b<=0)
{
cout<<"请输入正确的数字!
"<cout<<"$>";
cin>>b;
}
if(account[x]->get_money()
!
"<else{account[x]->dec_money(b);
account[i]->add_money(b);
cout<<"转帐成功!
";
}
return;
}
voidconsumer:
:
add_money(floatx)
{money=x+money;}
voidconsumer:
:
dec_money(floatx)
{
money=money-x;
}
voidYH:
:
addmoney(intx,floaty)
{account[x]->money=account[x]->money-y;
}
floatconsumer:
:
get_money()
{
returnmoney;
}
intmain()
{
system("color70");
inti=0;
cout<<"\t【】\t〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓【】"<for(i=0;i<3;i++)
cout<<"\t【】\t◎\t\t\t\t\t\t◎【】"<cout<<"\t【】\t◎◎◎Oo【欢迎进入银行账户管理系统】oO◎◎◎【】"<for(i=0;i<3;i++)
cout<<"\t【】\t◎\t\t\t\t\t\t◎【】"<cout<<"\t【】\t〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓【】"<cout<<"\t【】\t\t\t\t\t\t\t【】"<cout<<"\t【】┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅┅【】"<if(code()!
=4)
{
cout<<"\t\t输入次数已到!
\n";return0;
}
getch();
YHyh;
yh.functionshow();
return0;
}
voidYH:
:
functionshow()
{
intn;
do
{system("cls");
load();
cout<<"\t\t〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓"<cout<<"\t\t\t\t1)用户开户"<cout<<"\t\t〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓\n"<cout<<"请你输入相应的操作序号进行操作:
";
cin>>n;
while(n<1||n>4)
{
cout<<"请输入正确的操作序号!
"<cout<<"$>";
cin>>n;
}
switch(n)
{
case1:
set_account();break;
case2:
enter_account();break;
case3:
del_account();break;
case4:
exitYH();break;
}
cin.get();
}
while(true);
}
voidYH:
:
enter_account()
{
intid;
cout<<"请输入帐号:
";
cin>>id;
intflag=1;
inti=0;//__page_break__
while((i{
if(id==account[i]->get_id())flag=0;elsei++;
}
if(flag)
{
cout<<"帐号不存在!
"<return;
}
cout<<"请输入密码:
";
stringpassw;
cin>>passw;
if(passw!
=account[i]->get_passwd())return;
account[i]->display();
cin.get();
cin.get();
intn;
do{system("cls");
cout<<"\t\t〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓"<cout<<"\t\t\t\t1)查看信息"<<<"\t\t\t\t4)修改密码"<cout<<"\t\t〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓"<cout<<"请选择你要进行的操作:
"<cin>>n;
while(n<1||n>6)
{
cout<<"请输入正确的操作序号!
"<cout<<"谢谢";
cin>>n;
}
switch(n)
{case1:
account[i]->display();break;
case2:
account[i]->fetchmoney();save();break;
case3:
account[i]->savemoney();save();break;
case4:
account[i]->change_passwd();save();break;
case5:
transfer(i);save();break;
case6:
return;
}
cin.get();
cin.get();
}
while
(1);
}
voidYH:
:
set_account()
{
intid;
stringnam;
stringpassw;
floatm;
cout<";
cin>>id;
cout<";
cin>>nam;
cout<";
cin>>passw;
cout<";
cin>>m;
while(m<=0)
{
cout<<"请输入正确的数字!
"<cin>>m;
}
consumer*acc=newconsumer(id,nam,passw,m);
account[acnum]=acc;
cout<<"开户成功!
!
"<acnum++;
save();
cin.get();
return;}
voidYH:
:
del_account()
{
intid;
cout<";
cin>>id;
intflag=1;
inti=0;
while((i{
if(id==account[i]->get_id())
{
flag=0;
}
else
{
i++;
}
}
if(flag)
{
cout<<"帐号不存在!
"<return;
}
for(intj=i;j{
account[j]=account[j+1];
}
account[acnum-1]=NULL;
acnum--;
cout<<"注销成功!
!
"<save();
cin.get();
return;
}
voidconsumer:
:
change_passwd()
{
stringpwd,repwd;
cout<<"请输入新密码:
";
cin>>pwd;
cout<<"请再输入一次新密码:
";
cin>>repwd;
if(pwd!
=repwd)
cout<<"你输入的两次密码不一样,请重新输入!
"<passwd=pwd;
cout<<"密码修改成功,请牢记!
"<}
voidconsumer:
:
fetchmoney()
{
floatm;
charch;
do{
cout<"<<"$>"<cin>>m;
while(m<=0)
{
cout<<"请输入正确的数字!
"<cout<<"$>";
cin>>m;
}
if(money{
cout<<"对不起,你的余额不足!
"
<}else
{money=money-m;
cout<"
<cout<<"是否要继续该项操作:
(Y/N)"
<cout<<"$>";
cin>>ch;
while(ch!
='n'&&ch!
='N'&&ch!
='Y'&&ch!
='y')
{
cout<<"$>";
cin>>ch;
}
}while(ch=='y'||ch=='Y');
}voidconsumer:
:
savemoney()
{
floatc;
charch;
do
{
cout<"<<"$>"<cin>>c;
while(c<=0)
{
cout<<"请输入正确的数字!
"<cout<<"$>";
cin>>c;
}
money=money+c;
cout<<"操作已成功!
"<cout<<"是否要继续该项操作:
(Y/N)"<cout<<"$>";
cin>>ch;
while(ch!
='n'&&ch!
='N'&&ch!
='Y'&&ch!
='y')
{
cout<<"$>";
cin>>ch;
}
}while(ch=='y'||ch=='Y');
}
voidconsumer:
:
display()
{system("cls");
cout<<"**********************************"<cout<<"*"<cout<<"*用户姓名:
"<cout<<"*帐号:
"<cout<<"*余额:
"<cout<<"***************