C++银行管理系统方案文档格式.docx

上传人:b****4 文档编号:7779662 上传时间:2023-05-09 格式:DOCX 页数:19 大小:576.57KB
下载 相关 举报
C++银行管理系统方案文档格式.docx_第1页
第1页 / 共19页
C++银行管理系统方案文档格式.docx_第2页
第2页 / 共19页
C++银行管理系统方案文档格式.docx_第3页
第3页 / 共19页
C++银行管理系统方案文档格式.docx_第4页
第4页 / 共19页
C++银行管理系统方案文档格式.docx_第5页
第5页 / 共19页
C++银行管理系统方案文档格式.docx_第6页
第6页 / 共19页
C++银行管理系统方案文档格式.docx_第7页
第7页 / 共19页
C++银行管理系统方案文档格式.docx_第8页
第8页 / 共19页
C++银行管理系统方案文档格式.docx_第9页
第9页 / 共19页
C++银行管理系统方案文档格式.docx_第10页
第10页 / 共19页
C++银行管理系统方案文档格式.docx_第11页
第11页 / 共19页
C++银行管理系统方案文档格式.docx_第12页
第12页 / 共19页
C++银行管理系统方案文档格式.docx_第13页
第13页 / 共19页
C++银行管理系统方案文档格式.docx_第14页
第14页 / 共19页
C++银行管理系统方案文档格式.docx_第15页
第15页 / 共19页
C++银行管理系统方案文档格式.docx_第16页
第16页 / 共19页
C++银行管理系统方案文档格式.docx_第17页
第17页 / 共19页
C++银行管理系统方案文档格式.docx_第18页
第18页 / 共19页
C++银行管理系统方案文档格式.docx_第19页
第19页 / 共19页
亲,该文档总共19页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

C++银行管理系统方案文档格式.docx

《C++银行管理系统方案文档格式.docx》由会员分享,可在线阅读,更多相关《C++银行管理系统方案文档格式.docx(19页珍藏版)》请在冰点文库上搜索。

C++银行管理系统方案文档格式.docx

采用文件的重新写入来实现存取款。

四、程序的一些设计的技巧以及注意情况:

为了使程序模块化,我们要采用多文件的开发。

也就是说,为了使程序简练,把一些需要重复利用的代码写到.h的文件里面。

五、代码实现:

#include"

stdafx.h"

#include<

iostream>

map>

stack>

sstream>

stdio.h>

windows.h>

stdlib.h>

fstream>

vector>

algorithm>

Welcome_UI.h"

Register_UI.h"

Sign_UI.h"

Secondary_UI.h"

usingnamespacestd;

classBank_Management

{

private:

stringnew_name;

stringpre_name;

intpassword;

doubleextra_money;

public:

voidcreat_user(stringname,intpass);

intsign_user(stringname,intpass);

doubleaccount_balance();

voidwithdraw_money();

voidquery_account();

voidchange_password();

};

Bank_Managementoperation[1024];

ofstreamRec_history("

Historicalrecords.txt"

ios:

:

in|ios:

out|ios:

app);

intmain_ui()

printf("

\n\n"

);

\t\t%cWelcometouseBankManagementSystem!

%c\n"

3,3);

\t\t\t%cCopyrightbySunYu_peng!

4,4);

\t\t\t%c++++++++++++++++%c\n"

\t\t\t+Hereisthesystemmenu!

+\n"

\t\t\t++\n"

\t\t\t+1.Depositmoney+\n"

\t\t\t+2.Withdrawmoney+\n"

\t\t\t+3.Querybalance+\n"

\t\t\t+4.Historicalrecords+\n"

\t\t\t+5.Changepassword+\n"

\t\t\t+6.Saveandexit+\n"

\t\tPleaseentertheorderthatyouwant:

"

intorder;

cin>

>

order;

if(order==1)

{

system("

cls"

operation[0].account_balance();

}

elseif(order==2)

operation[0].withdraw_money();

elseif(order==3)

operation[0].query_account();

elseif(order==4)

printf("

\n\n\n\n"

Secondary_ui();

\tAlldateshavebeensavedinthefile(Historicalrecords.txt)"

Sleep(5000);

elseif(order==5)

operation[0].change_password();

elseif(order==6)

Rec_history<

<

Theuserdecidedtoexitthesystem!

\n"

;

return0;

else

Theuserhasdoneawrongoperation!

Thesystemexited!

}

voidBank_Management:

creat_user(stringname,intpass)

new_name=name;

password=pass;

intBank_Management:

sign_user(stringname,intpass)

ifstreamOpenFile("

Usernameandpassword.txt"

stringget_name;

intget_pass;

stack<

string>

sign;

stringstreamn;

stringpass_str;

n<

pass;

n>

pass_str;

while(OpenFile>

get_name>

get_pass)

stringstreamtemp;

stringtemp_str;

temp<

get_pass;

temp>

temp_str;

stringall_str=get_name+'

'

+temp_str;

sign.push(all_str);

while(sign.size()!

=0)

if(name+'

+pass_str==sign.top())

{

pre_name=name;

Rec_history<

Theuser:

<

name<

haslandedintheSystem"

."

"

returntrue;

}

else

sign.pop();

OpenFile.close();

doubleBank_Management:

account_balance()

Secondary_ui();

\t\tPleaseenterthemoneythatyouwantotdeposit:

double_money;

_money;

ifstreamDeposit_money("

Accountbalance.txt"

map<

string,double>

Deposit_Money;

:

iteratorit;

stringtemp;

while(Deposit_money>

temp>

extra_money)

if(temp==pre_name)

extra_money=extra_money+_money;

temp<

hasdeposited"

_money<

Yuan\n"

Deposit_Money.insert(pair<

(temp,extra_money));

Deposit_money.close();

ofstreamDepositMoney("

for(it=Deposit_Money.begin();

it!

=Deposit_Money.end();

it++)

DepositMoney<

it->

first<

\t"

second<

DepositMoney.close();

Sleep(1000);

system("

return0;

withdraw_money()

\t\tPleaseenterthemoneythatyouwanttowithdraw:

ifstreamWithdraw_money("

Withdraw_Money;

while(Withdraw_money>

extra_money=extra_money-_money;

Rec_history<

User:

haswithdrawed"

Withdraw_Money.insert(pair<

Withdraw_money.close();

ofstreamWithdrawMoney("

for(it=Withdraw_Money.begin();

=Withdraw_Money.end();

WithdrawMoney<

WithdrawMoney.close();

query_account()

ifstreamRead_only("

doubleextra;

cout<

\t\t\t\t"

Name"

Account\n"

while(Read_only>

extra)

cout<

extra<

endl;

Read_only.close();

Rec_history<

hasQueriedher/hisaccout!

Sleep(5000);

change_password()

intpass;

string,int>

change_password;

\t\tPleaseenterthenewpasswordyouwant:

doublenew_pass;

new_pass;

pass)

pass=new_pass;

change_password.insert(pair<

(temp,pass));

ofstreamres_pass("

for(it=change_password.begin();

=change_password.end();

res_pass<

Theuser"

pre_name<

haschangedhis/herpassword!

intmain()

stringname;

intcreat_num;

Softwarebegintoload!

while(true)

welcome_ui();

intorder;

cin>

if(order==1)

printf("

\t\tPleaseentertheprevioususer'

sname:

cin>

name;

\t\tPleaseenterprevioususer'

spassword:

password;

if(operation[0].sign_user(name,password)==1)

{

system("

main_ui();

}

else

printf("

\tSorry,youhavedoneawrongoperation!

Pleaserestartthesystemagain!

\a\n"

Rec_history<

Theuserwhosenameis"

hasfailedtoenterthesystem.\n"

Sleep(1000);

elseif(order==2)

system("

register_ui();

ofstreamCre_user;

Cre_user.open("

ofstreamIni_account;

Ini_account.open("

\t\tPleaseentertheuser'

squantityyouwant:

creat_num;

for(inti=0;

i<

creat_num;

i++)

\t\tPleaseenterthenew%d-user'

i+1);

cin>

\t\tPleaseenterthe%d-user'

Cre_user<

password<

Ini_account<

0<

Thesystemhascreatedauserwhosenameis"

Thesystemhasinitialized"

'

s"

account\n"

Cre_user.close();

Ini_account.close();

\tWehavesavedalloperations!

Sleep(1000);

elseif(order==3)

return0;

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

当前位置:首页 > 工程科技 > 能源化工

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2