![活期儲蓄賬目管理_第1頁](http://file2.renrendoc.com/fileroot_temp3/2021-4/24/a1cc4d33-0489-48b9-9764-6fb218a0ef68/a1cc4d33-0489-48b9-9764-6fb218a0ef681.gif)
![活期儲蓄賬目管理_第2頁](http://file2.renrendoc.com/fileroot_temp3/2021-4/24/a1cc4d33-0489-48b9-9764-6fb218a0ef68/a1cc4d33-0489-48b9-9764-6fb218a0ef682.gif)
![活期儲蓄賬目管理_第3頁](http://file2.renrendoc.com/fileroot_temp3/2021-4/24/a1cc4d33-0489-48b9-9764-6fb218a0ef68/a1cc4d33-0489-48b9-9764-6fb218a0ef683.gif)
![活期儲蓄賬目管理_第4頁](http://file2.renrendoc.com/fileroot_temp3/2021-4/24/a1cc4d33-0489-48b9-9764-6fb218a0ef68/a1cc4d33-0489-48b9-9764-6fb218a0ef684.gif)
![活期儲蓄賬目管理_第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),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、題目:活期儲蓄帳目管理活期儲蓄處理中,儲戶開戶、銷戶、存入、支出活動頻繁,系統(tǒng)設(shè)計要求:能比較迅速地找到儲戶的帳戶,以實現(xiàn)存款、取款記賬;并能實現(xiàn)排序能比較簡單,迅速地實現(xiàn)插入和刪除,以實現(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、開戶帳號 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讀取錯誤,無資料!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帳號不存在
6、!endlendl; return ; float b;coutendlb; while(b=0)cout請輸入正確的數(shù)字!endl;coutb; if(accountx-get_money()b) cout對不起,金額不夠!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請輸入正確的操作序號!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帳號不存在!endlendl; cin.get();return; coutpassw;if(passw!=accounti-get_passwd(
9、) return;accounti-display();cin.get();cin.get();int n;dosystem(cls);couttt請選擇你要進(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請輸入正確的數(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帳號不存在!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你輸入的兩次密碼不一樣,請重新輸入!endl;passwd=pwd;couttt密碼修改成功,請牢記!endl;cin.get(); void consumer:fetchmoney()float m;char ch;docoutendltt你要取多少錢:$m;while(m=0)couttt請輸入正
13、確的數(shù)字!endl;coutm;if(moneym)couttt對不起,你的余額不足!endl;elsemoney=money-m;coutendltt操作成功,請收好錢!endl;couttt是否要繼續(xù)該項操作:(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請輸入正確的數(shù)字!endl;coutc;money=money+c;couttt操作已成功!endl;couttt是否要繼續(xù)該項操作:(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等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 盆栽花卉市場與城市綠化的關(guān)系研究
- 工作入團(tuán)申請書格式
- 2024-2025上海家裝市場趨勢及策略指導(dǎo)白皮書
- 暖心工程申請書
- 2024-2025學(xué)年八年級物理上冊第四章光現(xiàn)象第5節(jié)光的色散作業(yè)設(shè)計新版新人教版
- 2024-2025學(xué)年高中物理課時作業(yè)二庫侖定律含解析新人教版選修3-1
- 2024-2025年高中化學(xué)4.1.1第1課時二氧化硅和硅酸講義+練習(xí)新人教版必修1
- 退住房公積金申請書
- 2024年高中化學(xué)第一章物質(zhì)結(jié)構(gòu)元素周期律第一節(jié)第1課時元素周期表精練含解析新人教版必修2
- 南京市民卡申請書
- 2025年度交通運(yùn)輸規(guī)劃外聘專家咨詢協(xié)議3篇
- 2024年04月北京中信銀行北京分行社會招考(429)筆試歷年參考題庫附帶答案詳解
- 專項債券培訓(xùn)課件
- 中央企業(yè)人工智能應(yīng)用場景案例白皮書(2024年版)-中央企業(yè)人工智能協(xié)同創(chuàng)新平臺
- 《會務(wù)的組織和管理》課件
- 《倒虹吸管安全評價導(dǎo)則》
- 2025年中國濕度傳感器行業(yè)深度分析、投資前景、趨勢預(yù)測報告(智研咨詢)
- 人民調(diào)解知識課件
- 《儒林外史》(第13-30回)-初中整本書閱讀系列之《儒林外史》
- 污水處理中的應(yīng)急預(yù)案與處置措施考核試卷
- 甘肅省蘭州市蘭煉一中2025屆數(shù)學(xué)高一上期末統(tǒng)考試題含解析
評論
0/150
提交評論