![銀行儲蓄系統(tǒng)c版實訓項目報告_第1頁](http://file2.renrendoc.com/fileroot_temp3/2021-10/29/714a1537-f4ca-4e74-b94c-c406c83ffa5e/714a1537-f4ca-4e74-b94c-c406c83ffa5e1.gif)
![銀行儲蓄系統(tǒng)c版實訓項目報告_第2頁](http://file2.renrendoc.com/fileroot_temp3/2021-10/29/714a1537-f4ca-4e74-b94c-c406c83ffa5e/714a1537-f4ca-4e74-b94c-c406c83ffa5e2.gif)
![銀行儲蓄系統(tǒng)c版實訓項目報告_第3頁](http://file2.renrendoc.com/fileroot_temp3/2021-10/29/714a1537-f4ca-4e74-b94c-c406c83ffa5e/714a1537-f4ca-4e74-b94c-c406c83ffa5e3.gif)
![銀行儲蓄系統(tǒng)c版實訓項目報告_第4頁](http://file2.renrendoc.com/fileroot_temp3/2021-10/29/714a1537-f4ca-4e74-b94c-c406c83ffa5e/714a1537-f4ca-4e74-b94c-c406c83ffa5e4.gif)
![銀行儲蓄系統(tǒng)c版實訓項目報告_第5頁](http://file2.renrendoc.com/fileroot_temp3/2021-10/29/714a1537-f4ca-4e74-b94c-c406c83ffa5e/714a1537-f4ca-4e74-b94c-c406c83ffa5e5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、實訓項目報告書項目名稱: 銀行綜合業(yè)務(wù)儲蓄平臺 c+版年級班級: 項目完成人: 實訓時間: 2012年 7月 5日至 2012 年7 月 9 日填 表 說 明一、本表由項目完成人填寫,一式一份;二、實訓結(jié)束前將填好的文稿打印后交實訓指導教師進行鑒定和評定成績,確認后的文檔交院校存檔保存;三、此表電子文檔及學生項目實訓的作品須打包存檔,壓縮文件包以學生學號命名,以班為單位收集,刻錄光盤交院校存檔;- 17 -實訓項目名稱銀行綜合業(yè)務(wù)儲蓄平臺 c+版項目組成員及其分工姓名分工情況承擔的主要工作一 需求分析登陸退出開戶 銷戶 查詢 存款 取款 轉(zhuǎn)賬二 概要設(shè)計banklinklist * listv
2、oid openaccount();void closeaccount();void deposit();void withdraw();void findaccount();void transaccount();linklistnode * headrecordint number;string username;string password;double balance;int flag;noderecord *record;node *next;三 詳細設(shè)計linklist();linklist();void sethead(node * head);node * gethead()
3、;node *makenode(record * record);void insertnode(node * node);node * findnode(int number);void display(); node * head;linklist noderecordrecord *record; node *next;int number;string username;string password;double balance;int flag;node();node();void setrecord(record *record);void setnext(node *next)
4、;record * getrecord();node * getnext();void display();record();void setnumber(int number);void setusername(string username);void setpassword(string password);void setbalance(double balance);void setflag(int flag);int getnumber();string getusername();string getpassword();double getblance();int getfla
5、g();void display();banklinklist * list;int accoutnumber;bank();bank();void setlist(linklist * list);linklist * getlist();int getaccountnumber();linklist * makelinklist();record*makerecord(string usernumber, string password, double balance);int creataccountnumber();int getnumber();string getusername(
6、);string getpassword();double getbalance();record * findrecord(int accountnumber);void openaccount();void closeaccount();void deposit();void withdraw();void findaccount();void transaccount();p=headp!=null head=nodep->next=nullp->next=nodep=p->nextendstart四 編碼實現(xiàn)record:record()this->number
7、 = 0;this->username = " "this->password = " "this->balance = 0.0;this->flag = -1;void record:setnumber(int number)this->number = number;void record:setusername(string username)this->username = username;void record:setpassword(string password)this->password =
8、password;void record:setbalance(double blance)this->balance = blance;void record:setflag(int flag)this->flag = flag;int record:getnumber()return this->number;string record:getusername() return this->username;string record:getpassword()return this->password;double record:getblance()ret
9、urn this->balance;int record:getflag()return this->flag;void record:display()cout<<"print record elements."<<endl;cout<<"number:"<<this->number<<endl; cout<<"username:"<<this->username<<endl;cout<<"p
10、assword:"<<this->password<<endl;cout<<"blalance:"<<this->balance<<endl;cout<<"flag:"<<this->flag<<endl;cout<<"end of record."<<endl;record.h#ifndef header_record#define header_record#include <s
11、tring>using namespace std;class recordprivate:int number;string username;string password;double balance;int flag;public:record();void setnumber(int number);void setusername(string username);void setpassword(string password);void setbalance(double balance);void setflag(int flag);int getnumber();st
12、ring getusername();string getpassword();double getblance();int getflag();void display();#endifrecord.cpp#include"record.h"#include<iostream>using namespace std;record:record()this->number = 0;this->username = " "this->password = " "this->balance = 0.0;
13、this->flag = -1;node.cpp#include"node.h"#include<iostream>using namespace std;node:node()this->record=null;this->next=null;node:node()delete this->record; /this->record=null;this->next = null;void node:setrecord(record *record)this->record = record;void node:setn
14、ext(node *next)this->next = next;node * node:getnext()return this->next;record * node:getrecord()return this->record;void node:display()cout<<"print node elements."<<endl;/cout<<"record"<<this->record<<endl;if (this->record = null)cout
15、<<"the elements of record is null"<<endl;elsethis->record->display(); /輸出this->record對象指針所指向cout<<"next:"<<this->next<<endl;cout<<"end of node."<<endl;node.h#ifndef header_node#define header_node#include "record
16、.h"class nodeprivate:record *record;node *next;public:node();node();void setrecord(record *record);void setnext(node *next); record * getrecord();node * getnext();void display();#endifnode * linklist:gethead()return this->head;node * linklist:makenode(record * record)node * node = new node()
17、;node->setrecord(record);node->setnext(null);return node;void linklist:insertnode(node *node)node * p = this->head; /p指向頭結(jié)點if (p = null) /判斷頭結(jié)點是否為空,如果為空,node即為頭節(jié)點this->head = node;else /否則鏈表不為空while (p->getnext() != null) /p指向鏈表中最后一個節(jié)點p = p->getnext();p->setnext(node); /將node鏈接到
18、最后一個節(jié)點后面node * linklist:findnode(int number)node * p = this->head;while (p != null)if (p->getrecord()->getnumber() = number)return p;elsep = p->getnext();return p;void linklist:display()node * p = this->head;linklist.h#ifndef header_linklist#define header_linklist#include "node.h
19、"class linklistprivate: node * head;public:linklist();linklist();void sethead(node * head);node * gethead();node *makenode(record * record); /根據(jù)賬戶指針record創(chuàng)建鏈表節(jié)點void insertnode(node * node); /將node指針指向的節(jié)點插入到鏈表node * findnode(int number); /根據(jù)賬號在鏈表中查找節(jié)點void display(); /顯示鏈表; #endif linklist.cpp#in
20、clude"linklist.h"#include<iostream>using namespace std;linklist:linklist()this->head = null;linklist:linklist()node * p, * q;p = this->head;while (p != null)q = p->getnext();delete p;p = q;this->head = null; void linklist:sethead(node * head)this->head = head; bank.cpp
21、#include "bank.h"#include<iostream>using namespace std;bank:bank()this->list = this->makelinklist();this->accoutnumber = 10000;bank:bank()delete this->list;this->list = null;void bank:setlist(linklist * list)this->list = list;linklist * bank:getlist()return this->
22、;list;int bank:getaccountnumber()return this->accoutnumber;linklist * bank:makelinklist()linklist * list = new linklist();return list;record * bank:makerecord(string username, string password, double balance)record * record = new record();int number = this->creataccountnumber();record->setn
23、umber(number);record->setusername(username);record->setpassword(password);record->setbalance(balance);record->setflag(1);return record;int bank:creataccountnumber()this->accoutnumber = this->accoutnumber +1;return this->accoutnumber;cout<<"print linklist elements.&quo
24、t;<<endl;if (p = null)cout<<"this linklist is null."<<endl;elsewhile (p != null)p->display();p = p->getnext();cout<<"end of linklist."<<endl;cout<<endl;bank.h#ifndef header_bank#define header_bank#include "linklist.h"class bankp
25、rivate:linklist * list;int accoutnumber;public:bank();bank();void setlist(linklist * list);linklist * getlist();int getaccountnumber();linklist * makelinklist();record * makerecord(string usernumber, string password, double balance);int creataccountnumber();int getnumber();string getusername();strin
26、g getpassword();double getbalance();record * findrecord(int accountnumber);void openaccount();void closeaccount();void deposit();void withdraw();void findaccount();void transaccount();#endifstring password = this->getpassword();double balance = this->getbalance();record * record = this->mak
27、erecord(username, password, balance);/顯示賬戶信息record->display();/將賬戶插入到鏈表node * node = this->list->makenode(record);this->list->insertnode(node);/顯示開戶成功cout<<"open an account succeed."<<endl;record * bank:findrecord(int accountnumber)node * node = this->list->
28、;findnode(accountnumber);if(node != null)return node->getrecord();elsereturn null;void bank:closeaccount()/獲取用戶輸入的銷戶賬號int number = this->getnumber();/根據(jù)賬號查找賬戶record * record = this->findrecord(number);if(record != null)/獲取用戶輸入密碼string password = this->getpassword();if(password = record-&
29、gt;getpassword()/判斷賬戶狀態(tài)if(record->getflag() != 0)/修賬戶狀態(tài)record->setflag(0);int bank:getnumber()int number;cout<<"plase input number."<<endl;cin>>number;cout <<"your number:"<<number<<endl;return number;string bank:getusername()string usern
30、ame = ""cout<<"plase input username."<<endl;cin>>username;cout<<"your username"<<username<<endl;return username;string bank:getpassword()string password = ""cout<<"plase input password."<<endl;cin>&g
31、t;password;cout<<"your password"<<password<<endl;return password;double bank:getbalance()double balance = 0.0;cout<<"plase input balance."<<endl;cin>>balance;cout<<"your balance"<<balance<<endl;return balance;void ba
32、nk:openaccount()/創(chuàng)建賬戶/生成賬戶/由用戶輸入用戶名、密碼、金額/由系統(tǒng)生成賬號string username = this->getusername();elsecout<<"password error."<<endl;elsecout<<"not found."<<endl;void bank:withdraw()/獲取用戶輸入取款賬號int number = this->getnumber();/根據(jù)賬號查找賬戶record * record = this->fi
33、ndrecord(number);if(record != null)/獲取用戶輸入密碼string password = this->getpassword();if(password = record->getpassword()/判斷賬戶狀態(tài)if(record->getflag() != 0)/修改賬戶金額double balance = this->getbalance();if(record->getblance() >= balance)record->setbalance(record->getblance() - balance)
34、;record->display();elsecout<<"not enough."<<endl;elsecout<<"the flag is 0."<<endl;record->display();elsecout<<"the flag is 0."<<endl;elsecout<<"password error."<<endl;elsecout<<"not found."&
35、lt;<endl;void bank:deposit()/獲取用戶輸入存款賬號int number = this->getnumber();/根據(jù)賬號查找賬戶record * record = this->findrecord(number);if(record != null)/獲取用戶輸入密碼string password = this->getpassword();if(password = record->getpassword()/判斷賬戶狀態(tài)if(record->getflag() != 0)/修改賬戶金額double balance = thi
36、s->getbalance();record->setbalance(record->getblance() + balance);record->display();elsecout<<"the flag is 0."<<endl;main.cpp#include "bank.h"#include <iostream>using namespace std;void login(bank * bank);void mainmenu(bank * bank);void mainmenu(bank
37、 * bank)int choice = -1;docout <<endl;cout <<"0 exit."<<endl;cout <<"1 open account"<<endl;cout <<"2 find account"<<endl;cout <<"3 close account"<<endl;cout <<"4 deposit"<<endl;cout &l
38、t;<"5 withdraw"<<endl;getchar();cin >> choice;switch (choice)case 0:exit (0);case 1:bank->openaccount();break;case 2:bank->findaccount();break;case 3:bank->closeaccount();break;case 4:bank->deposit();break;case 5:bank->withdraw();break;default:cout <<&qu
39、ot;error." <<endl;while(true); void login(bank * bank)string adminusername;string adminpassword;cout <<"please input admin username."<<endl;cin >>adminusername;elsecout<<"password error."<<endl;elsecout<<"not found."<<
40、;endl;void bank:findaccount()/獲取用戶輸入查詢賬號int number = this->getnumber();/根據(jù)賬號查找賬戶record * record = this->findrecord(number);if(record != null)/獲取用戶輸入密碼string password = this->getpassword();if(password = record->getpassword()/顯示賬戶信息record->display();elsecout<<"password error.
41、"<<endl;elsecout<<"not found."<<endl;測試代碼testrecord.cpp#include"record.h"int main()record *record;record = new record();record->display();record->setnumber(10001);record->setusername("jone");record->setpassword("123456");reco
42、rd->setbalance(1000.00);record->setflag(1);record->display();return 0;cout <<"please input admin password."<<endl;cin >>adminpassword;for(int i = 1;i <= 3;i +)if(adminusername = "admin" && adminpassword = "admin")mainmenu(bank);else
43、if (i < 2)cout <<"please input admin username."<<endl;cin >>adminusername;cout <<"please input admin password."<<endl;cin >>adminpassword;continue;elsecout << "sorry" <<endl;break;int main()bank * bank = new bank();login(bank);return 0;testlinklist.cpp#include "linklist.
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 海航寵物運輸協(xié)議書(2篇)
- 二零二五年全新借款合同范本:債權(quán)轉(zhuǎn)化股權(quán)操作手冊3篇
- 二零二五年度高端醫(yī)療美容分期支付服務(wù)協(xié)議2篇
- 礦山專用設(shè)備項目融資渠道探索
- 2025年度學校體育場地照明設(shè)施升級改造合同(含下載)2篇
- 2025至2030年中國步速跟隨型大腿數(shù)據(jù)監(jiān)測研究報告
- 2025至2030年智能溫度在線監(jiān)測系統(tǒng)項目投資價值分析報告
- 二零二五攤位租賃合同范本(精簡版)-@-2
- 2025至2030年反光高頻壓花項目投資價值分析報告
- 2025至2030年功率合金帶繞線型電阻器項目投資價值分析報告
- 九年級下冊滬教版上?;瘜W5.2酸和堿的性質(zhì)研究 課件
- 益生芽孢桿菌體外抑菌活性及耐藥性研究
- 2023數(shù)聯(lián)網(wǎng)(DSSN)白皮書
- ISO17025經(jīng)典培訓教材
- 消防設(shè)施操作和維護保養(yǎng)規(guī)程
- 餐飲行業(yè)品牌介紹商務(wù)宣傳PPT模板
- 東南大學宣講介紹
- 2023年菏澤醫(yī)學??茖W校單招綜合素質(zhì)題庫及答案解析
- 九年級下冊-2023年中考歷史總復習知識點速查速記(部編版)
- GB/T 18103-2022實木復合地板
- 釀酒工藝教案
評論
0/150
提交評論