Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

11.9 (Account Inheritance Hierarchy) Create an inheritance hierarchy that a bank m represent customers' bank accounts. All customers at this bank can deposit Ge, redi

image text in transcribed
image text in transcribed
11.9 (Account Inheritance Hierarchy) Create an inheritance hierarchy that a bank m represent customers' bank accounts. All customers at this bank can deposit Ge, redi their accounts and withdraw (i.e., debit) money from their accounts. More specifictves ot also exist. Savings accounts, for instance, earn interest on the money they hold. Checkine on the other hand, charge a fee per transaction. dtera might Create base class Account and derived classes SavingsAccount and CheckingAccout inherit from class Account. Base class Account should include one private instance variableof decimal to represent the account balance. The class should provide a constructor that recia initial balance and uses it to initialize the instance variable with a public property. The paope should validate the initial balance to ensure that it's greater than or equal to 0.0; if not, dhroe exception. Th should add an anaur to the current balance. Method Debit should withdraw money from the Account the debit amount does not exceed the Account's balance. If it does, the balance unchanged, and the method should display the message "Debit amount exce ance. " The class should also provide a get accessor in property Balance that re e class should provide two public methods. Method Credit and ensure the should be l eded account the c turns balance. Derived class SavingsAccount should inherit the functionality of an Acco a decimal instance variable indicating the interest rate (percentage) assignca dur ingsAccount's constructor should receive the initial balance, as weus est rate. SavingsAccount should provide public method CalculateInter indicating the amount of interest earned by an account. Method Calcu to as an initial hat alculateInterest shouldd

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions

Question

Which form of proof do you find most persuasive? Why?

Answered: 1 week ago