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

下載本文檔

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

文檔簡(jiǎn)介

1、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)境下編寫(xiě)測(cè)試完成,涉及類(lèi)的概念, 異常處理機(jī)制,基本上模擬了 ATM系統(tǒng)的相關(guān)實(shí)現(xiàn),且代碼內(nèi)標(biāo)注大量注釋, 讀者可以很輕松的看清楚。2. 技術(shù)說(shuō)明當(dāng)輸入用戶的卡號(hào)和密碼時(shí),系統(tǒng)能登錄 ATM柜員機(jī)系統(tǒng),用戶可以按照以下規(guī)則進(jìn)行:(1)查詢余額:初始余額為10000元(2)ATM取款:每次取款金額為100的倍數(shù),總額不超過(guò)5000元,支取金額不允許透 支。(3)ATM存款:不能出現(xiàn)負(fù)存款。(4)修改密碼:新密碼長(zhǎng)度不小于 6位,不允許出現(xiàn)6位完全相同的情況,只有舊密 碼正確,新

2、密碼符合要求,且兩次輸入相同的情況下才可以成功修改密碼。3. 系統(tǒng)設(shè)計(jì)3.1功能說(shuō)明本系統(tǒng)主要模擬銀行ATMn系統(tǒng)功能,主要有查閱、取款、存款、賬戶修改密碼等功能啟動(dòng)系統(tǒng)賬戶登錄3.2De查的p詢it存I4.測(cè)試存IWithd取款rawinquireCahngepas改密*驗(yàn)證登陸無(wú)法成功執(zhí)行解決方法:查資料,上網(wǎng)查詢*修改密碼某些要求無(wú)法實(shí)現(xiàn)解決方法:查資料,上網(wǎng)查詢5總結(jié)總的來(lái)說(shuō),本次設(shè)計(jì)當(dāng)中存有許多的不足之處,基本上設(shè)計(jì)出了和自己預(yù)想中的效果,但同時(shí)在設(shè)計(jì)上也還存在著很多的,很多事沒(méi)有什么用的代碼,我想是因?yàn)闀r(shí)間 和經(jīng)驗(yàn)的問(wèn)題,以后多練習(xí)就肯定能提高。仔細(xì)地看,還是有一些小問(wèn)題。通過(guò)ja

3、va編寫(xiě)簡(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é)合,提高自己的分析、解決問(wèn)題的能力,并且讓我明白了計(jì)算機(jī)的 技術(shù)一定要從實(shí)際出發(fā)才能真正的提高自己的能力;6.參考文獻(xiàn)安博教育java核心技術(shù)電子工業(yè)出版社8.源代碼package other;/ATM模擬系統(tǒng)importpublic class ATM private St

4、ringAccountNum =; / 賬號(hào)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)/判斷新密碼長(zhǎng)度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("請(qǐng)輸入存款金額:");amount =sc. next In t(

7、);if ( amount<0)/避免出現(xiàn)負(fù)存款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("請(qǐng)輸入取款金額:”);amount =se. next In t();"Withdraw

8、limit:¥ 0- ¥ 5000");/取款為100倍數(shù)if (amount >5000| amount<0)/ 每次取款不能超過(guò) 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)/取款后余額不能為負(fù)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 請(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 (

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 ) 密碼錯(cuò)誤");/驗(yàn)證登陸密碼"登陸成功,進(jìn)入主菜單!");"n);"n);"n);"n);"n);"n請(qǐng)輸入選擇:");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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝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ù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 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)論