| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 644 人关注过本帖
标题:[求助]希望能看懂英文的帮忙一下
只看楼主 加入收藏
jamiexia
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-4-6
收藏
 问题点数:0 回复次数:9 
[求助]希望能看懂英文的帮忙一下

我不能够把MEMO传上来我就简单的描述一下。随便画了个图。做出来就是这样的,看哪位高手能帮忙一下。我把图片 上传成附件了。想帮忙的请看一下,拜托了

下面是要求:

Basic Idea
Write a simple ATM-style program. The user types one or more names and amounts in the upper text area and then clicks on of the following three buttons: add a new account, deposit to an account or withdrawl from an account. The current accounts and their balances show up in the lower text area. To run a demo, type demo.hw3 in a lab machine terminal window.


--------------------------------------------------------------------------------

Specifications

The GUI must look exactly like the one in the demo. You must get explicit permission from me to modify it in any way.


The functionalities of the buttons are self explanatory. There is no upper or lower limit on individual account balances. (Other than the min and max values that a double can hold).


If the user tries to create accounts that already exist, then those accounts are not created again, and don't bother printing an error message. If the user tries to deposit to or withdrawl from accounts that don't exist, the amounts for those accounts are not modified and, as above, no error message is needed.


The input to the top text area must be in the following format:

<ws> Name <ws> : <ws> Amount <ws+>


<ws> = Zero or more whitespace characters (space, tab or newline)
<ws+> = One or more whitespace characters (space, tab or newline)


If the user's input is missing the : delimeter, then print an appropriate error message to the bottom of the window.


If the user's input has a messed-up value for the "amount", then print an appropriate error message to the bottom of the window.


--------------------------------------------------------------------------------

Program Structure
You are responsible for writing three classes:

ATMMain
This is the main class. It contains the main method, which simply creates an ATM and an ATMGUI. The whole thing should be about 4 lines long (minus comments).
ATMGUI
This is the class with the majority of the code in it. The constructor of this class should set up the window. ATMGUI should also implement ActionListener so that it can act as its own action handler.

In the actionPerformed method of this class, you should read in the user's input and parse it character-by-character into names and amounts. You may not use any of the fancy Java parsing tools. You can use only two methods in the String class: charAt() and length(). This part will require a lot of loops.

Once the input has been parsed and depending on which button has been pressed, you pass the name and amount on to the ATM to either create an account, deposit or withdrawl.

Finally, you print the updated contents of the ATM to the lower text area.
ATM
The ATM class is fairly simple. It acts as a "wrapper" for a TreeMap object in which you will store the actual accounts and balances. The ATM should have at least four methods:
newAccount(String, Double) - puts a new account into the TreeMap
deposit(String, Double) - deposits into an account in the TreeMap
withdrawl(String, Double) - withdrawls from an account in the TreeMap
getAccounts() - returns a String representation of all the accounts in the tree map. This is the String that will show up in the lower text area.

--------------------------------------------------------------------------------

Hints
Setting up the window is not difficult, but it does take a lot of code and, possibly, nitpicking. I will be giving out example code that should help simplify this process.
Parse one account from the input and then process it and then repeat for the next account in the input. In other words, Don't try to parse all the accounts at once, because this would require storing them somewhere until you are ready to send them to the ATM. You can do it however you want, but I think this is easier.
Constructing a String representation of the contents of the TreeMap isn't too difficult, but it does require a few tricky lines of code. Keep your eyes peeled for useful examples in class.

--------------------------------------------------------------------------------

Grading
10 - Code Style. Use Javadoc comments and make your code pretty or suffer the consequences!
15 - You made an obvious attempt to write something, even if it doesn't compile.
20 - The GUI looks exactly like the demo.
10 - The newAccount button works.
10 - The deposit button works.
10 - The withdrawl button works.
10 - Program is organized as described above.
15 - All input of the correct form is accepted and all input of the incorrect form is rejected. (with appropriate error messages)

图片附件: 游客没有浏览图片的权限,请 登录注册

搜索更多相关主题的帖子: following accounts current deposit simple 
2007-04-06 12:08
黄袖标
Rank: 4
等 级:贵宾
威 望:13
帖 子:676
专家分:0
注 册:2007-3-22
收藏
得分:0 

太长了。。。


我胡汉三又回来啦!物是人非啊,只有静夜思大大还在。
2007-04-06 19:05
jamiexia
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-4-6
收藏
得分:0 
还俗称最牛的java论坛呢。就一个回帖还说太长了,郁闷。
2007-04-06 19:36
狂飙的蜗牛
Rank: 1
等 级:新手上路
帖 子:174
专家分:0
注 册:2007-1-23
收藏
得分:0 
2007-04-06 20:19
whypoppy
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-4-7
收藏
得分:0 
你是要翻译?

2007-04-07 00:47
jamiexia
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-4-6
收藏
得分:0 
我不是要翻译,我是想谁能帮我看看怎么做。
2007-04-07 01:41
jamiexia
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-4-6
收藏
得分:0 
拜托
2007-04-07 01:41
Sur_Michael
Rank: 2
等 级:论坛游民
帖 子:23
专家分:20
注 册:2007-3-20
收藏
得分:0 
找人帮你做作业的?

2008 更加努力
2007-04-07 08:55
jamiexia
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-4-6
收藏
得分:0 

谢谢大家的留言,无论是帮上忙的还是帮不上忙的,我已经独立的完成了这份算是作业的作业,很满意。
并且在原来的基础上加了点东西。明天会帖上程序。

2007-04-09 10:43
jamiexia
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-4-6
收藏
得分:0 

之所以这道题目是英文的,是因为我现在在美国读大学,所以呢,希望呢,你们也借此学习一下,美国大学一年纪的JAVA 课程的作业就是这样的

2007-04-09 10:44
快速回复:[求助]希望能看懂英文的帮忙一下
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012350 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved