銀行儲(chǔ)蓄系統(tǒng)c版實(shí)訓(xùn)項(xiàng)目報(bào)告_第1頁
銀行儲(chǔ)蓄系統(tǒng)c版實(shí)訓(xùn)項(xiàng)目報(bào)告_第2頁
銀行儲(chǔ)蓄系統(tǒng)c版實(shí)訓(xùn)項(xiàng)目報(bào)告_第3頁
銀行儲(chǔ)蓄系統(tǒng)c版實(shí)訓(xùn)項(xiàng)目報(bào)告_第4頁
銀行儲(chǔ)蓄系統(tǒng)c版實(shí)訓(xùn)項(xiàng)目報(bào)告_第5頁
已閱讀5頁,還剩12頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、實(shí)訓(xùn)項(xiàng)目報(bào)告書項(xiàng)目名稱: 銀行綜合業(yè)務(wù)儲(chǔ)蓄平臺(tái) c+版年級(jí)班級(jí): 項(xiàng)目完成人: 實(shí)訓(xùn)時(shí)間: 2012年 7月 5日至 2012 年7 月 9 日填 表 說 明一、本表由項(xiàng)目完成人填寫,一式一份;二、實(shí)訓(xùn)結(jié)束前將填好的文稿打印后交實(shí)訓(xùn)指導(dǎo)教師進(jìn)行鑒定和評(píng)定成績,確認(rèn)后的文檔交院校存檔保存;三、此表電子文檔及學(xué)生項(xiàng)目實(shí)訓(xùn)的作品須打包存檔,壓縮文件包以學(xué)生學(xué)號(hào)命名,以班為單位收集,刻錄光盤交院校存檔;- 17 -實(shí)訓(xùn)項(xiàng)目名稱銀行綜合業(yè)務(wù)儲(chǔ)蓄平臺(tái) c+版項(xiàng)目組成員及其分工姓名分工情況承擔(dān)的主要工作一 需求分析登陸退出開戶 銷戶 查詢 存款 取款 轉(zhuǎn)賬二 概要設(shè)計(jì)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;三 詳細(xì)設(shè)計(jì)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四 編碼實(shí)現(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對(duì)象指針?biāo)赶騝out<<"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é)點(diǎn)if (p = null) /判斷頭結(jié)點(diǎn)是否為空,如果為空,node即為頭節(jié)點(diǎn)this->head = node;else /否則鏈表不為空while (p->getnext() != null) /p指向鏈表中最后一個(gè)節(jié)點(diǎn)p = p->getnext();p->setnext(node); /將node鏈接到

18、最后一個(gè)節(jié)點(diǎn)后面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é)點(diǎn)void insertnode(node * node); /將node指針指向的節(jié)點(diǎn)插入到鏈表node * findnode(int number); /根據(jù)賬號(hào)在鏈表中查找節(jié)點(diǎn)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()/獲取用戶輸入的銷戶賬號(hào)int number = this->getnumber();/根據(jù)賬號(hào)查找賬戶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)生成賬號(hào)string username = this->getusername();elsecout<<"password error."<<endl;elsecout<<"not found."<<endl;void bank:withdraw()/獲取用戶輸入取款賬號(hào)int number = this->getnumber();/根據(jù)賬號(hào)查找賬戶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()/獲取用戶輸入存款賬號(hào)int number = this->getnumber();/根據(jù)賬號(hào)查找賬戶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()/獲取用戶輸入查詢賬號(hào)int number = this->getnumber();/根據(jù)賬號(hào)查找賬戶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等.壓縮文件請(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ì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論