当前位置: 代码迷 >> Java相关 >> 遇到一道题用继承和多态的题不会了
  详细解决方案

遇到一道题用继承和多态的题不会了

热度:374   发布时间:2013-09-17 11:43:36.0
遇到一道题用继承和多态的题不会了

                    

You are to create a set of classes to implement a banking mode in Java, and are expected to employ the techniques of inheritance and polymorphism.

A bank has account owners, each of them may have one or more bank accounts, such as savings accounts, checking accounts, and business accounts. Each account has the following information stored as private data: such as name,  account_number, and balance.  At the end of each month, the bank issues a statement for each bank account containing the following information: name, SSN, account_number, phone_number, open balance, and close balance. The close balance is the open balance plus the interest calculated based on the type of the account. To simplify your task, you can assume that there was no transaction in the past month.

With a polymorphic method, the interest of each account is calculated differently:
1.    No interest for business accounts
2.    2.5% interest for each checking account
3.    4% for each saving account if the balance  < $5000
5% otherwise

You may need to create the following classes: accounts, business_accounts, checking_accounts, savings_accounts, and the driver class.

Read the following data from a file and use it  to test your program:

NAME         ACCOUNT          PHONE        SSN            BALANCE             TYPE

Sam        78192222        555-0498    123-45-6789         4500               B
Carla       74329832        555-9812    233-98-3831        230                C
Woody       72872911        555-9281    823-23-0911        5700               S
Diane       63672822        555-9232    212-11-0091        2300               S
Norm       27873773         555-2932    918-22-0911        1400               C
Cliff       38737737        555-9171    811-12-9811        6700               S
Tom        72932331         555-9283    235-09-9282       7800                C

Submit your program along with the output produced


搜索更多相关的解决方案: techniques  following  accounts  business  expected  

----------------解决方案--------------------------------------------------------
我靠,这不为难我吗?题目翻译下
----------------解决方案--------------------------------------------------------
题目看了下,你是哪不会啊,这么含糊的问,不知道你想问什么
----------------解决方案--------------------------------------------------------
我靠,看不懂英文。
----------------解决方案--------------------------------------------------------
问先楼主先,你看得懂题目意思吗?
题目让你创建一个银行的简易工作模式,可能会用多继承和多态,(这是废话)
让你读取最下面的数据,做过测试。
需求就是中间那段,这有什么不会做的,写一个类,把那些变量都加进去。处理下逻辑关系,注意类之间的继承和实现,就OK了。
莫名就这么扔一个题目上来等人给你做题啊?
这年头学生都这样了!!!
----------------解决方案--------------------------------------------------------
凌乱啊英文
----------------解决方案--------------------------------------------------------
  相关解决方案