Java銀行ATM模擬系統(tǒng)報(bào)告.doc_第1頁(yè)
已閱讀5頁(yè),還剩5頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

Java核心技術(shù)上結(jié)課報(bào)告班級(jí): 學(xué)號(hào): 姓名: 銀行ATM機(jī)模擬系統(tǒng) 1. 設(shè)計(jì)內(nèi)容本系統(tǒng)采用JAVA語(yǔ)言并在eclipse環(huán)境下編寫測(cè)試完成,涉及類的概念,異常處理機(jī)制,基本上模擬了ATM系統(tǒng)的相關(guān)實(shí)現(xiàn),且代碼內(nèi)標(biāo)注大量注釋,讀者可以很輕松的看清楚。2. 技術(shù)說明當(dāng)輸入用戶的卡號(hào)和密碼時(shí),系統(tǒng)能登錄ATM柜員機(jī)系統(tǒng),用戶可以按照以下規(guī)則進(jìn)行:(1)查詢余額:初始余額為10000元(2)ATM取款:每次取款金額為100的倍數(shù),總額不超過5000元,支取金額不允許透支。(3)ATM存款:不能出現(xiàn)負(fù)存款。(4)修改密碼:新密碼長(zhǎng)度不小于6位,不允許出現(xiàn)6位完全相同的情況,只有舊密碼正確,新密碼符合要求,且兩次輸入相同的情況下才可以成功修改密碼。3. 系統(tǒng)設(shè)計(jì)3.1功能說明 啟動(dòng)系統(tǒng) 本系統(tǒng)主要模擬銀行ATM機(jī)系統(tǒng)功能,主要有查閱、取款、存款、賬戶修改密碼等功能。 賬戶登錄 查詢 退出 修改密碼 取款款 存款3.2類的設(shè)計(jì)DepositWithdrawinquireCahngepas存款取款查詢改密4. 測(cè)試*驗(yàn)證登陸無法成功執(zhí)行解決方法:查資料,上網(wǎng)查詢*修改密碼某些要求無法實(shí)現(xiàn)解決方法:查資料,上網(wǎng)查詢5. 總結(jié)總的來說,本次設(shè)計(jì)當(dāng)中存有許多的不足之處,基本上設(shè)計(jì)出了和自己預(yù)想中的效果,但同時(shí)在設(shè)計(jì)上也還存在著很多的,很多事沒有什么用的代碼,我想是因?yàn)闀r(shí)間和經(jīng)驗(yàn)的問題,以后多練習(xí)就肯定能提高。仔細(xì)地看,還是有一些小問題。通過java編寫簡(jiǎn)單的ATM登錄系統(tǒng)的設(shè)計(jì),我不僅復(fù)習(xí)了上學(xué)期的java編程設(shè)計(jì)基 礎(chǔ)知識(shí),并且增強(qiáng)了我對(duì)java語(yǔ)言的領(lǐng)悟和應(yīng)用,同時(shí)也更深刻的懂得了學(xué)好學(xué)會(huì)了并不是代表能夠真正的在實(shí)踐中運(yùn)用得流暢,這次實(shí)踐給了我們一個(gè)既動(dòng)手又動(dòng)腦獨(dú)立實(shí)踐的機(jī)會(huì),但其中也包含了自我尋找資料的能力和同學(xué)間的合作能力。這個(gè)系統(tǒng)將理論和實(shí)踐相結(jié)合,提高自己的分析、解決問題的能力,并且讓我明白了計(jì)算機(jī)的技術(shù)一定要從實(shí)際出發(fā)才能真正的提高自己的能力;6. 參考文獻(xiàn)安博教育java核心技術(shù)電子工業(yè)出版社8. 源代碼package other;/-ATM模擬系統(tǒng)-import java.util.Scanner;public class ATM private String AccountNum=1367111222;/賬號(hào) private String password=123456;/密碼 private long balance=10000;/初始余額Scanner sc=new Scanner(System.in);/構(gòu)造函數(shù)public ATM()public ATM(String temp,String temp2)this.AccountNum=temp;this.password=temp2;/-修改密碼模塊-public void changePassword(String oldPass,String password)if(!oldPass.equals(this.password)/判斷初始密碼System.err.println(Wrong initial password.);return;if(password.length()6)/判斷新密碼長(zhǎng)度System.err.println(Password too short.);return;if(this.password.equals(password) /不能與原密碼相同System.err.println(Password cannot be the same.);return;this.password=password;System.out.println(newpassword:+this.password);/-查詢余額模塊- public long balanceInquery()return this.balance; /-存款模塊- public void deposit() int amount; System.out.println(請(qǐng)輸入存款金額:); amount=sc.nextInt();if(amount5000|amount0) /每次取款不能超過5000System.err.println(Withdraw limit:¥0-¥5000);System.exit(0);if(amount%100)!=0) /取款為100倍數(shù)System.err.println(The amount has to be a product of100);System.exit(0);long newBalance=this.balance-amount;if(newBalance0) /取款后余額不能為負(fù)System.err.println(Not enough money in the account); this.balance=newBalance; System.out.println(balance=+this.balance); /-主界面顯示模塊- public void menu() int select; ATM a=new ATM(); tryString AccountNum=1367111222;String password=123456;Scanner sc=new Scanner(System.in);System.out.println(-歡迎使用ATM模擬系統(tǒng)-);System.out.print(t請(qǐng)輸入賬號(hào):);AccountNum=sc.next();System.out.print(t請(qǐng)輸入密碼:);password=sc.next();if (!AccountNum.equals(this.AccountNum) System.err.println(賬號(hào)錯(cuò)誤); /驗(yàn)證登陸賬號(hào)System.exit(0); else if (!password.equals(this.password) System.err.println(密碼錯(cuò)誤); /驗(yàn)證登陸密碼System.exit(0); else System.out.println(登陸成功,進(jìn)入主菜單!);doSystem.out.println(n *1查詢*);System.out.println(n *2取款*);System.out.println(n *3存款*);System.out.println(n *4修改密碼*);System.out.println(n *0退出*);System.out.println(n請(qǐng)輸入選擇:);System.out.println(-);select=sc.nextInt();switch(select)case 1:System.out.println(Balance=+a.balanceInquery();/余額查詢break;case 2: a.withdraw(); /取款break;case 3:a.deposit();/存款break;case 4:System.out.println(Oldpassword:);String temp=sc.next();System.out.println(Newpassword:);String temp2=sc.next();a.changePassword(temp,temp2);/改密break;case 0:System.exit(0);/退出break;default:System.out.println(請(qǐng)輸入數(shù)字1-5)

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(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)論