![活期儲(chǔ)蓄賬目管理_第1頁](http://file2.renrendoc.com/fileroot_temp3/2021-4/24/a1cc4d33-0489-48b9-9764-6fb218a0ef68/a1cc4d33-0489-48b9-9764-6fb218a0ef681.gif)
![活期儲(chǔ)蓄賬目管理_第2頁](http://file2.renrendoc.com/fileroot_temp3/2021-4/24/a1cc4d33-0489-48b9-9764-6fb218a0ef68/a1cc4d33-0489-48b9-9764-6fb218a0ef682.gif)
![活期儲(chǔ)蓄賬目管理_第3頁](http://file2.renrendoc.com/fileroot_temp3/2021-4/24/a1cc4d33-0489-48b9-9764-6fb218a0ef68/a1cc4d33-0489-48b9-9764-6fb218a0ef683.gif)
![活期儲(chǔ)蓄賬目管理_第4頁](http://file2.renrendoc.com/fileroot_temp3/2021-4/24/a1cc4d33-0489-48b9-9764-6fb218a0ef68/a1cc4d33-0489-48b9-9764-6fb218a0ef684.gif)
![活期儲(chǔ)蓄賬目管理_第5頁](http://file2.renrendoc.com/fileroot_temp3/2021-4/24/a1cc4d33-0489-48b9-9764-6fb218a0ef68/a1cc4d33-0489-48b9-9764-6fb218a0ef685.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、題目:活期儲(chǔ)蓄帳目管理活期儲(chǔ)蓄處理中,儲(chǔ)戶開戶、銷戶、存入、支出活動(dòng)頻繁,系統(tǒng)設(shè)計(jì)要求:能比較迅速地找到儲(chǔ)戶的帳戶,以實(shí)現(xiàn)存款、取款記賬;并能實(shí)現(xiàn)排序能比較簡單,迅速地實(shí)現(xiàn)插入和刪除,以實(shí)現(xiàn)開戶和銷戶的需要。#include#include #include#includeusing namespace std;class consumer;class yhpublic:yh();void set_account();/銀行開戶void del_account();void transfer(int); /轉(zhuǎn)賬void enter_account();void addmoney(int,flo
2、at);void exityh();/ 退出系統(tǒng)void functionshow();/ 功能界面void save();void load();protected: consumer *account20;/賬戶數(shù) static int acnum;int yh:acnum=0;yh:yh()for(int i=0;i20;i+) accounti = null; class consumer:public yhpublic: friend class yh; consumer(int id,string name,string password,float m) id=id;name=n
3、ame;money=m;passwd=password; consumer()id=0;name=0;money=0;passwd=0; int get_id()return id; void savemoney();/ 取錢 string get_passwd() / 取得密碼 return passwd; void display(); void fetchmoney(); /取錢 void change_passwd(); void add_money(float); void dec_money(float); float get_money(); private: int id; /
4、開戶帳號(hào) string passwd; / 用戶密碼 string name; / 用戶姓名 float money;void yh:save()ofstream ofile(bankdat.dat,ios:out);ofstream outfile(bankdat.dat,ios:out);int n=0;outfileacnum ;for(;nacnum;n+)outfileid ;outfilemoney ;outfilename ;outfilepasswd ;outfile.close(); void yh:load()ifstream infile(bankdat.dat,ios:
5、in);if(!infile)cerr讀取錯(cuò)誤,無資料!acnum;for(;nid;infilem;infilenam;infilepassw;accountn-passwd;consumer * acc = new consumer(id,nam,passw,m); accountn = acc; infile.close();cout讀取資料正常!endl;void yh:transfer(int x)int id; coutid; int flag = 1; int i = 0; while(iget_id() flag = 0; else i+; if(flag) cout帳號(hào)不存在
6、!endlendl; return ; float b;coutendlb; while(b=0)cout請(qǐng)輸入正確的數(shù)字!endl;coutb; if(accountx-get_money()b) cout對(duì)不起,金額不夠!dec_money(b);accounti-add_money(b);return;void consumer:add_money(float x)money=x+money;void consumer:dec_money(float x)money=money-x;void yh:addmoney(int x,float y)accountx-money=account
7、x-money-y;float consumer:get_money()return money;void yh:functionshow()int n;int z=1;dosystem(cls); couttt*銀行管理系統(tǒng)*endl;/couttt 1.用戶開戶 endl;couttt 2.賬戶登陸 endl;couttt 3.帳戶注銷 endl;couttt 0.退出系統(tǒng) endl;couttt*endl;load();coutendln;if(n3) couttt請(qǐng)輸入正確的操作序號(hào)!endl; cout; cinn;switch(n)case 1: set_account() ;br
8、eak;case 2:enter_account() ;break;case 3: del_account() ;break; case 0: exityh();z=0 ;break;cin.get();while(z);void yh:enter_account()int id; coutid; int flag = 1; int i = 0; /while(iget_id() flag = 0; else i+; if(flag) couttt帳號(hào)不存在!endlendl; cin.get();return; coutpassw;if(passw!=accounti-get_passwd(
9、) return;accounti-display();cin.get();cin.get();int n;dosystem(cls);couttt請(qǐng)選擇你要進(jìn)行的操作:endltt1)查看信息endltt2)取款endltt3)存款endltt4)修改密碼endltt5)轉(zhuǎn)賬endltt6)返回n;switch(n)case 1: accounti-display();break;case 2: accounti-fetchmoney();save();break;case 3:accounti-savemoney();save();break;case 4:accounti-change_
10、passwd();save();break;case 5:transfer(i);save();break;case 6:return;cin.get();cin.get();while(1);void yh:set_account() int id; string nam; string passw; float m;coutendlid; coutendlnam; coutendlpassw; coutendlm; while(m=0)couttt請(qǐng)輸入正確的數(shù)字!m;consumer * acc = new consumer(id,nam,passw,m); accountacnum =
11、 acc; couttt開戶成功!endlendl; acnum+;save();cin.get();return;void yh:del_account() int id; coutendlid;int flag = 1; int i = 0; while(iget_id()flag = 0;elsei+; if(flag) couttt帳號(hào)不存在!endlendl; return; coutpassw;if(passw!=accounti-get_passwd() return;for(int j=i;jacnum;j+) accountj = accountj+1; accountacn
12、um-1=null; acnum-; couttt注銷成功!endlendl; save();cin.get();return; void consumer:change_passwd()string pwd,repwd;coutpwd;coutrepwd;if(pwd!=repwd)couttt你輸入的兩次密碼不一樣,請(qǐng)重新輸入!endl;passwd=pwd;couttt密碼修改成功,請(qǐng)牢記!endl;cin.get(); void consumer:fetchmoney()float m;char ch;docoutendltt你要取多少錢:$m;while(m=0)couttt請(qǐng)輸入正
13、確的數(shù)字!endl;coutm;if(moneym)couttt對(duì)不起,你的余額不足!endl;elsemoney=money-m;coutendltt操作成功,請(qǐng)收好錢!endl;couttt是否要繼續(xù)該項(xiàng)操作:(y/n) endl;cout;cinch;while(ch!=n&ch!=n&ch!=y&ch!=y)cout;cinch;while(ch=y|ch=y);void consumer:savemoney() float c; char ch;docoutendltt你要存多少錢:$c;while(c=0)couttt請(qǐng)輸入正確的數(shù)字!endl;coutc;money=money+c;couttt操作已成功!endl;couttt是否要繼續(xù)該項(xiàng)操作:(y/n) endl;cout;cinch;while(ch!=n&ch!=n&ch!=y&ch!=y)cout;cinch;while(ch=y|ch=y); void consumer:display()system(cls
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- Unit 5 Free Time Let's Check(教學(xué)設(shè)計(jì))-2023-2024學(xué)年人教新起點(diǎn)版英語四年級(jí)下冊(cè)
- 17他們那時(shí)候多有趣啊教學(xué)設(shè)計(jì)-2023-2024學(xué)年六年級(jí)下冊(cè)語文統(tǒng)編版
- 全國粵教清華版初中信息技術(shù)八年級(jí)下冊(cè)第2單元第4節(jié)《搭建智能應(yīng)用》教學(xué)設(shè)計(jì)
- 12《玩也有學(xué)問》教學(xué)設(shè)計(jì)-2024-2025學(xué)年道德與法治一年級(jí)上冊(cè)統(tǒng)編版
- 學(xué)院081102檢測(cè)技術(shù)與自動(dòng)化裝置報(bào)錄數(shù)據(jù)分析報(bào)告
- Unit 5 Music Reading for Writing(教學(xué)設(shè)計(jì))高一英語同步高效課堂(人教版2019必修第二冊(cè))
- Unit 2 topic 1 You should brush your teeth.Section B 教學(xué)設(shè)計(jì)-2024-2025學(xué)年 仁愛科普版英語八年級(jí)上冊(cè)
- Module 5 Unit 1 We went to the Great Wall.(教學(xué)設(shè)計(jì))-2024-2025學(xué)年外研版(一起)英語四年級(jí)上冊(cè)
- 科技創(chuàng)新中心項(xiàng)目組織結(jié)構(gòu)與管理模式
- 地方高??蒲袆?chuàng)新與產(chǎn)學(xué)研結(jié)合策略
- 《研學(xué)旅行課程設(shè)計(jì)》課件-研學(xué)課程設(shè)計(jì)計(jì)劃
- 會(huì)議記錄表格樣本
- 馬工程《藝術(shù)學(xué)概論》
- 改善護(hù)理服務(wù)行動(dòng)計(jì)劃方案
- 羧基麥芽糖鐵注射液-臨床用藥解讀
- 《手語基礎(chǔ)學(xué)習(xí)》課件
- 建筑材料包銷協(xié)議書
- 2023-2024學(xué)年高中政治統(tǒng)編版必修三1-1 中華人民共和國成立前各種政治力量 課件(23張)
- SJG 09-2024 建筑基樁檢測(cè)標(biāo)準(zhǔn)
- 河南省南陽市淅川縣2023-2024學(xué)年八年級(jí)上學(xué)期期末考試數(shù)學(xué)試題(含答案)
- 口腔臨床技術(shù)操作規(guī)范
評(píng)論
0/150
提交評(píng)論