银行业问题 [英] Banking Problem

查看:51
本文介绍了银行业问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

请阅读以下问题。首先。


假设银行维护两种账户

客户称为

储蓄账户&另外作为经常账户。

储蓄账户提供简单的利息&

取款设施但没有支票簿设施。

当前账户提供支票预订设施,但

无利息。

经常账户持有人还应保持最低

余额,如果最低余额低于此

级别将收取服务费。


创建一个存储客户姓名的类帐户,

account no&账户类型
此类中的
派生类当前acc&

储蓄acc。使它们更具特定于他们的环境的b $ b。包括必要的

成员函数以实现以下任务:

1.接受客户存款并计算

余额
2.显示余额

3.计算并存入利息

4.允许撤销并更新余额

5.检查最小余额,如果需要
,则处以罚款并更新余额


- >>不使用构造函数和使用成员函数

初始化类别成员


(注意:#MAKE一个额外的现场日期(包括DOS.H到

访问日期)结构)

#使用链接列表制作此程序

我面临的问题是,当我创建了两个派生类

as有定向,我必须为每个派生类创建两个链接列表。因此,在修改,存款或任何其他操作的时间,我必须

搜索链接列表,这将非常耗时&如果没有

这样的账户存在,那将是最糟糕的情况。然后我想b $ b认为另一个解决方案,我通过采取(保存

&当前类)早期派生类作为基类&来制作另一个派生类。创建一个

链接列表。现在,问题在于,当我的帐户正在保存类型时,

我当前的课程完全不受影响(浪费)&反之亦然。

我想通过合并两个链表制作单个链表。是否有人

建议我解决方案。程序应该是菜单驱动的。


谢谢

解决方案

ashu写道:< blockquote class =post_quotes>大家好,
请阅读以下问题。首先。

假设一家银行为客户维护了两种账户,一种称为储蓄账户&另外作为经常账户。
储蓄账户提供简单的兴趣和退出设施但没有支票簿设施。
经常账户提供支票簿设施,但没有兴趣。

创建一个存储类帐户客户姓名,
帐户号码&此类帐户
从此课程中获取当前acc&
储蓄acc。使他们更加特定于他们的环境。包括必要的会员功能,以实现以下任务:
1.接受客户存款并计算余额
2.显示余额
3。计算并存入利息
4.允许撤销并更新余额
5.检查最小化余额,如果需要则处以罚款并更新余额

- >>不要使用构造函数和使用成员函数来初始化类别成员

(注意:#MAKE额外的现场日期(包括DOS.H到
)访问日期结构)
#MAKE这个程序使用链接列表)

我面临的问题是,当我按照指示创建两个派生类
时,我必须创建每个派生类的两个链接列表。因此,在修改,存款或任何其他操作的时候,我必须搜索链接列表,这将是非常耗时的。如果不存在这样的账户,那将是最糟糕的情况。然后我想另一个解决方案,我通过将(保存
&当前类)早期派生类作为基类和&来创建另一个派生类。创建单个链接列表。现在,问题在于,当我的帐户保存类型时,
我当前的课程完全没有被触及(浪费)&反之亦然。
我想通过合并两个链接列表来制作单个链接列表。有人会建议我解决方案吗?程序应该是菜单驱动的。

谢谢你




见这个常见问题:

http://www.parashift.com/c++ -faq-lit ... t.html#faq-5.2


此新闻组适用于C ++语言问题。如果您有特定的

语言相关问题,我们很乐意为您提供帮助。否则,你

可能想尝试comp.programming或

comp.please.do.my.homework.for.me。


欢呼! --M


mlimber写道:

ashu写道:
[snip]

我面临的问题是,当我按照指示创建了两个派生类时,我必须为每个派生类创建两个链接列表。因此,在修改,存款或任何其他操作的时候,我必须搜索链接列表,这将是非常耗时的。如果不存在这样的账户,那将是最糟糕的情况。然后我想另一个解决方案,我通过将(保存
&当前类)早期派生类作为基类和&来创建另一个派生类。创建单个链接列表。现在,问题在于,当我的帐户保存类型时,
我当前的课程完全没有被触及(浪费)&反之亦然。
我想通过合并两个链接列表来制作单个链接列表。有人会建议我解决方案吗?程序应该是Menu Driven。



[snip]这个新闻组是针对C ++语言的问题。如果您有与语言相关的特定问题,我们将很乐意为您提供帮助。否则,你可能想尝试comp.programming或
comp.please.do.my.homework.for.me。




不要急于将此视为主题。实际上,那里有一个

语言问题:给定两个类,派生自一个共同的基础,

C ++是否有一种机制可以将两种类型的对象都放在同一个基础上

容器。如果是这样,推荐的是什么呢?


一个可能的答案是:你可以使用指向基座的指针容器

class 。甚至更好,使用一个容器引用计数smart_pointers

基类,以便内存管理仍然是自动的。


到OP:这应该得到你开始。当你有一个

你的代码的草稿时再次发布,你遇到了更严重的问题。另外,请执行

不要为链表滚动自己的代码。使用std :: list<>代替。它会给你带来严重的麻烦。

最好


Kai-Uwe Bux


感谢您考虑我的问题&指导我这么好。因为我是哎呀噢噢噢噢噢噢噢噢噢噢噢噢噢噢噢噢噢噢噢噢噢噢那么请你告诉我

什么是指针容器,参考计数容器

smart_pointers ???。


And 请不要为链表滚动自己的代码。使用

std :: list<>代替" ?????这条线意味着什么。请告诉我。


hi to all,
Please read the following ques. first.

assume that a bank maintains 2 kinds of accounts for
customers one called as
savings accounts & other as current account.
the savings account provides simple interest &
withdraw facilities but no check book facilities.
the current account provides check book facilities but
no interest.
current account holders should also maintain a minimum
balance and if the minimum balance falls below this
level a service charge is to be imposed.

create a class account that stores customers name,
account no & type of account
from this class derive the classes current acc &
savings acc. to make them more
specific to their environments. include necessary
member functions in order to achieve following tasks:
1. accept the deposit from the customer and compute
the balance
2. display the balance
3. compute and deposit the interest
4. permit the withdrawl and update the balance
5. check the minimun balance, impose penalty if
necessary &update the balance

-->>DO NOT USE CONSTRUCTORS AND USE MEMBER FUNCTIONS
TO INITIALIZE THE CLASS MEMBERS

(NOTE: #MAKE AN EXTRA FIELD DATE (INCLUDE DOS.H TO
ACCESS DATE STRUCTURE)
#MAKE THIS PROGRAM BY USING LINK LIST )
The problem i am facing is that when i have created two derived class
as directed, i have to create two linklist to each derived class. So at
the time of modifing, depositing or any other operation, i have to
search both the linklist, which will be very time consuming & if no
such account exist, it would be the worst of the worst case. Then i
think another solution, i make another derived class by taking (saving
& current class) early derived class as base class & create a single
linklist. Now, the problem in that is, when my account is saving type,
my current class in totally untouched(wasted) & vice-versa.
I want to make a single linklist by merging two linklist. Would anyone
suggest me the solution. The program should be Menu Driven.

Thank You

解决方案

ashu wrote:

hi to all,
Please read the following ques. first.

assume that a bank maintains 2 kinds of accounts for
customers one called as
savings accounts & other as current account.
the savings account provides simple interest &
withdraw facilities but no check book facilities.
the current account provides check book facilities but
no interest.
current account holders should also maintain a minimum
balance and if the minimum balance falls below this
level a service charge is to be imposed.

create a class account that stores customers name,
account no & type of account
from this class derive the classes current acc &
savings acc. to make them more
specific to their environments. include necessary
member functions in order to achieve following tasks:
1. accept the deposit from the customer and compute
the balance
2. display the balance
3. compute and deposit the interest
4. permit the withdrawl and update the balance
5. check the minimun balance, impose penalty if
necessary &update the balance

-->>DO NOT USE CONSTRUCTORS AND USE MEMBER FUNCTIONS
TO INITIALIZE THE CLASS MEMBERS

(NOTE: #MAKE AN EXTRA FIELD DATE (INCLUDE DOS.H TO
ACCESS DATE STRUCTURE)
#MAKE THIS PROGRAM BY USING LINK LIST )
The problem i am facing is that when i have created two derived class
as directed, i have to create two linklist to each derived class. So at
the time of modifing, depositing or any other operation, i have to
search both the linklist, which will be very time consuming & if no
such account exist, it would be the worst of the worst case. Then i
think another solution, i make another derived class by taking (saving
& current class) early derived class as base class & create a single
linklist. Now, the problem in that is, when my account is saving type,
my current class in totally untouched(wasted) & vice-versa.
I want to make a single linklist by merging two linklist. Would anyone
suggest me the solution. The program should be Menu Driven.

Thank You



See this FAQ:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.2

This newsgroup is for C++ language questions. If you have a specific
language-related question, we will be happy to help you. Otherwise, you
might want to try in comp.programming or
comp.please.do.my.homework.for.me.

Cheer! --M


mlimber wrote:

ashu wrote: [snip]

The problem i am facing is that when i have created two derived class
as directed, i have to create two linklist to each derived class. So at
the time of modifing, depositing or any other operation, i have to
search both the linklist, which will be very time consuming & if no
such account exist, it would be the worst of the worst case. Then i
think another solution, i make another derived class by taking (saving
& current class) early derived class as base class & create a single
linklist. Now, the problem in that is, when my account is saving type,
my current class in totally untouched(wasted) & vice-versa.
I want to make a single linklist by merging two linklist. Would anyone
suggest me the solution. The program should be Menu Driven.


[snip] This newsgroup is for C++ language questions. If you have a specific
language-related question, we will be happy to help you. Otherwise, you
might want to try in comp.programming or
comp.please.do.my.homework.for.me.



Don''t be so eager to dismiss this as off topic. Actually, there is a
language question in there: given two classes, deriving from a common base,
does C++ have a mechanism to have objects of both types in the same
container. If so, what is the recommended was to go about it?

And a possible answer is: you can use a container of pointers to the base
class. Better even, use a container of reference counting smart_pointers to
the base class so that memory management is still automatic.

To the OP: this should get you started. Post again when you have a draft of
your code and you are running into more serious problems. Also, please do
not roll your own code for the linked list. Use std::list<> instead. It
will save you serious headache.
Best

Kai-Uwe Bux


Thank you for considering my problem & guiding me so well. As i''m new
to the Oops, i not know much about Oops. So would you please tell me
what are containers of pointers, container of reference counting
smart_pointers???.

And "please do not roll your own code for the linked list. Use
std::list<> instead" ????? what does this line means. please tell me.


这篇关于银行业问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆