鱼C论坛

 找回密码
 立即注册
查看: 2554|回复: 3

Java作业紧急求助

[复制链接]
发表于 2013-8-29 20:35:56 | 显示全部楼层 |阅读模式
30鱼币
制作一个关于ATM的 .jar 文件需要有如下功能。银行卡密码是9753,  账户余额是 $1000
银行卡密码和账户余额都要加密后存储在一个叫做atm.mny的文件里 加密的 encryption key 要被存储在名字叫secret.key 的文件里. 历史操作记录被保存在名为trans.hst的文件里
程序的效效果如下

> java -jar atm.jar
Welcome to the ATM
Enter PIN:
1234
Sorry wrong PIN
Bye

> java -jar atm.jar
Welcome to the ATM
Enter PIN:
9753
ACCESS MENU
0 to quit
1 to withdraw money
2 to find balance
Your choice:
1
Enter amount:
230
$230 dispensed
ACCESS MENU
0 to quit
1 to withdraw money
2 to find balance
Your choice:
2
The balance is $770
ACCESS MENU
0 to quit
1 to withdraw money
2 to find balance
Your choice:
1
Enter amount:
800
Sorry, not enough money in the account.
ACCESS MENU
0 to quit
1 to withdraw money
2 to find balance
Your choice:
0
Bye

> java -jar atm.jar
Welcome to the ATM
Enter PIN:
9753
ACCESS MENU
0 to quit
1 to withdraw money
2 to find balance
Your choice:
1
Enter amount:
170
$170 dispensed
ACCESS MENU
0 to quit
1 to withdraw money
2 to find balance
Your choice:
2
The balance is $600
ACCESS MENU
0 to quit
1 to withdraw money
2 to find balance
Your choice:
0
Bye

> java -jar atm.jar
Welcome to the ATM
Enter PIN:
9753
ACCESS MENU
0 to quit
1 to withdraw money
2 to find balance
3 to show history
Your choice:
3
BEGIN HISTORY:
Entered wrong PIN
Entered correct PIN
Withdrew 230
Found balance 770
Attempted withdraw 800
Entered correct PIN
Withdrew 170
Found balance 600
Entered correct PIN
Displayed history
END HISTORY
ACCESS MENU
0 to quit
1 to withdraw money
2 to find balance
3 to show history
Your choice:
0
Bye

做好之后可以在这里发源码也可以发给我邮箱heuseal@qq.com

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2013-8-30 21:52:51 | 显示全部楼层
加密要是要哪一种啊??

加密有很多种滴!!
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2013-8-31 10:20:42 | 显示全部楼层
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2013-9-1 16:47:37 | 显示全部楼层
呵呵!加密就不会了,我只会不加密的
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-12-23 06:05

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表