| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 618 人关注过本帖
标题:遇到一道题用继承和多态的题不会了
取消只看楼主 加入收藏
嘟嘟好运气
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-9-17
结帖率:0
收藏
已结贴  问题点数:20 回复次数: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 
2013-09-17 11:43
快速回复:遇到一道题用继承和多态的题不会了
数据加载中...
 
   



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

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