Home / Expert Answers / Computer Science / python-programming-nbsp-10-16-account-inheritance-hierarchy-create-an-inheritance-hierarchy-pa130

(Solved): python programming  \( 10.16 \) (Account Inheritance Hierarchy) Create an inheritance hierarchy ...



python programming 


\( 10.16 \) (Account Inheritance Hierarchy) Create an inheritance hierarchy that a beas might use to represent customer bank
\( 10.16 \) (Account Inheritance Hierarchy) Create an inheritance hierarchy that a beas might use to represent customer bank accounts. All customers at this bank can depoin money into their accounts and withdraw money from their accounts. More specific tpps of accounts also exist. Savings accounts, for instance, earn interest on the money they hold. Checking accounts, on the other hand, don't earn interest and charge a fee per transaction. Start with class Account from this chapter and create two subclasses SavingsAccount and CheckingAccount. A SavingsAccount should also include a data attribute indicating the interest rate. A SavingsAccount's calculate_interest method should return the Decimal result of multiplying the interest rate by the account balance. SavingsAccount should inherit methods deposit and withdraw without redefining them. A CheckingAccount should include a Decimal data attribute that represents the foct charged per transaction. Class CheckingAccount should override methods deposit and withdraw so that they subtract the fee from the account balance whenever either transection is performed successfully. CheckingAccount's versions of these methods should invoke the base-class Account versions to update the account balance. CheckingAccount's wi thd raw method should charge a fee only if money is withdrawn (that is, the withdramal) amount does not exceed the account balance). Create objects of each class and tests their methods. Add interest to the Savingstccount object by invoking its calculate_interest method, then passing the returned interest amount to the object's deposit method.


We have an Answer from Expert

View Expert Answer

Expert Answer


ANSWER IS AS FOLLOWS: CODE IS AS FOLLOWS: class Account: def __init__(self, bal): self.balance = bal def deposit (self, amt): self.balance += amt def
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe