seal@heu 发表于 2013-8-29 20:35:56

Java作业紧急求助

制作一个关于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

565123 发表于 2013-8-30 21:52:51

加密要是要哪一种啊??

加密有很多种滴!!

seal@heu 发表于 2013-8-31 10:20:42

565123 发表于 2013-8-30 21:52 static/image/common/back.gif
加密要是要哪一种啊??

加密有很多种滴!!

DES加密,谢谢

565123 发表于 2013-9-1 16:47:37

呵呵!加密就不会了,我只会不加密的
页: [1]
查看完整版本: Java作业紧急求助