


版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、Java核心技術(shù)上結(jié)課報告班級:學(xué)號:姓名:銀行ATM機模擬系統(tǒng)1. 設(shè)計內(nèi)容本系統(tǒng)采用JAVA語言并在eclipse環(huán)境下編寫測試完成,涉及類的概念, 異常處理機制,基本上模擬了 ATM系統(tǒng)的相關(guān)實現(xiàn),且代碼內(nèi)標注大量注釋, 讀者可以很輕松的看清楚。2. 技術(shù)說明當輸入用戶的卡號和密碼時,系統(tǒng)能登錄 ATM柜員機系統(tǒng),用戶可以按照以下規(guī)則進行:(1)查詢余額:初始余額為10000元(2)ATM取款:每次取款金額為100的倍數(shù),總額不超過5000元,支取金額不允許透 支。(3)ATM存款:不能出現(xiàn)負存款。(4)修改密碼:新密碼長度不小于 6位,不允許出現(xiàn)6位完全相同的情況,只有舊密 碼正確,新
2、密碼符合要求,且兩次輸入相同的情況下才可以成功修改密碼。3. 系統(tǒng)設(shè)計3.1功能說明本系統(tǒng)主要模擬銀行ATMn系統(tǒng)功能,主要有查閱、取款、存款、賬戶修改密碼等功能啟動系統(tǒng)賬戶登錄3.2De查的p詢it存I4.測試存IWithd取款rawinquireCahngepas改密*驗證登陸無法成功執(zhí)行解決方法:查資料,上網(wǎng)查詢*修改密碼某些要求無法實現(xiàn)解決方法:查資料,上網(wǎng)查詢5總結(jié)總的來說,本次設(shè)計當中存有許多的不足之處,基本上設(shè)計出了和自己預(yù)想中的效果,但同時在設(shè)計上也還存在著很多的,很多事沒有什么用的代碼,我想是因為時間 和經(jīng)驗的問題,以后多練習(xí)就肯定能提高。仔細地看,還是有一些小問題。通過ja
3、va編寫簡單的ATM登錄系統(tǒng)的設(shè)計,我不僅復(fù)習(xí)了上學(xué)期的java編程設(shè)計基 礎(chǔ)知識,并且增強了我對java語言的領(lǐng)悟和應(yīng)用,同時也更深刻的懂得了學(xué)好學(xué)會了 并不是代表能夠真正的在實踐中運用得流暢,這次實踐給了我們一個既動手又動腦獨 立實踐的機會,但其中也包含了自我尋找資料的能力和同學(xué)間的合作能力。這個系統(tǒng) 將理論和實踐相結(jié)合,提高自己的分析、解決問題的能力,并且讓我明白了計算機的 技術(shù)一定要從實際出發(fā)才能真正的提高自己的能力;6.參考文獻安博教育java核心技術(shù)電子工業(yè)出版社8.源代碼package other;/ATM模擬系統(tǒng)importpublic class ATM private St
4、ringAccountNum =; / 賬號privateStringpassword ="123456" ; / 密碼private long balanee =10000; / 初始余額Scanner se = new Scann er(System.in);/構(gòu)造函數(shù)public ATM()public ATM(Stringtemp,Stringtemp2 )this . AccountNum 二temp;this . password =temp2 ;/ 修改密碼模塊public void changePassword(StringoldPass ,String p
5、assword )if (! oldPass .equals( this . password ) / 判斷初始密碼 System. err .println("Wrong initial password.");return ;if ( passwordength()<6)/判斷新密碼長度System. err .println( "Password too short." ); return ;if (this . password .equals( password )/ 不能與原密碼相同System. err .println( "
6、;Password cannot be the same.");return ;this . password =password ;System. out .println("newpassword:" +this . password );/ 查詢余額模塊public long balancelnquery() return this . balanee ;/ 存款模塊public void deposit()int amount;System. out .println("請輸入存款金額:");amount =sc. next In t(
7、);if ( amount<0)/避免出現(xiàn)負存款System. err .println("Cannot deposit negative amount");return ;this . balanee +=amount;System. out .println("balanee二" +this . balanee );/取款模塊-public void withdraw()int amount;System. out .println("請輸入取款金額:”);amount =se. next In t();"Withdraw
8、limit:¥ 0- ¥ 5000");/取款為100倍數(shù)if (amount >5000| amount<0)/ 每次取款不能超過 5000System. err .println(System. exit (0);if ( amount%100)!=0)System. err .println( "The amount has to be a product of100");System. exit (0);long newBalanee =this . balanee - amount;if ( newBalanee <
9、0)/取款后余額不能為負System. err .pri ntl n( "Not eno ugh money in the aeeo un t");this . balanee =newBalanee ;System. out .println("balanee二"+this . balanee );/主界面顯示模塊-publicvoid menu()intselect ;ATMa=new ATM();tryStringAeeo un tNum =;String password 二"123456"Scanner se= new Sc
10、ann er(System.in);System. out .println( ”歡迎使用ATM模擬系統(tǒng)");System. out .print( "t 請輸入賬號:");AccountNum 二sc.next();System. out .print( "t 請輸入密碼:”);password =sc. next();if (! AccountNum .equals( this . AccountNum ) System. err .println("賬號錯誤");/驗證登陸賬號System. exit (0);else if (
11、! passwordSystem. err .println(System. exit (0);else System. out .println(doSystem. out .println(*1詢 *"System. out .println(* 2款 *"System. out .println(*3士h *" 仔款System. out .println(*4彳修改密碼 *"System. out .println(*0退出 *"System. out .println(System.out .println("IIhsele
12、ct =sc .n ext In t();?quals(this . password ) 密碼錯誤");/驗證登陸密碼"登陸成功,進入主菜單!");"n);"n);"n);"n);"n);"n請輸入選擇:");switch (select )case 1:/余額查詢System. out .println("Balanee二"+a.balancelnquery();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:");Stri ng temp2 =sc. next();a.changePassword( temp , temp2 ); / 改密 break ;case 0:System. exit (0); / 退出 break ;default :System. out .
溫馨提示
- 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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 乳品工藝技術(shù)創(chuàng)新與發(fā)展考核試卷
- 勘察項目項目管理氣候變化與勘察應(yīng)對策略考核試卷
- 批發(fā)市場的產(chǎn)品陳列與促銷技巧考核試卷
- 施工監(jiān)督與試車開車中安全注意事項考核試卷
- 小學(xué)生天氣安全教育課件
- 農(nóng)田土壤售賣合同范本
- 個人產(chǎn)品交易合同范本
- 玻璃浴房合同范本
- 委托裝修安全合同范本
- 礦供銷合同范本
- TBPMA 0009-2021 生活飲用水二次供水水箱(池)清洗消毒技術(shù)規(guī)范
- LY/T 2499-2015野生動物飼養(yǎng)場總體設(shè)計規(guī)范
- 佛教空性與緣起課件
- 民兵組織建設(shè)課件
- 腹腔鏡下闌尾切除術(shù)護理課件
- 《抖音生活服務(wù)服務(wù)商合作手冊》
- 語文教學(xué)設(shè)計(教案目標)
- 工程造價三級復(fù)核
- 皮膚性病學(xué)課件:濕疹皮炎
- 綠化養(yǎng)護重點難點分析及解決措施
- 一體化學(xué)工服務(wù)平臺、人事管理系統(tǒng)、科研管理系統(tǒng)建設(shè)方案
評論
0/150
提交評論