Explain why the Teller application can call the withdraw and
Explain why the Teller application can call the \"withdraw\" and \"deposit\" methods using a \"SavingsAccount\" object reference, even though we did not define these methods.
Explain why your \"applyInterest\" method in the \"SavingsAccount\" class needs to call the \"deposit\" method of the \"BankAccount\" class.
Explain in full details this is an program assignment.
Solution
1. Teller Applications are in general used for Banking Purpose/Currency Transaction Pupose in Real Time Environment.
Those applications generally do the Operations such as Crediting/Debiting the Customer\'s Account, Maintaining the list of the transactions performed by the Customer/Account Holder.
When a Customer tries to operate his account such as deposit funds to account or withdraw funds from the account, Then the Teller application needs to search for the predifined/Existing classes to perform the operations required to the customer.
So as to perform those operations without risk management we will be using some methods and predefined classes to maintain the accuracy of the transactions.
Hence when the Teller application is instructed to do Withdraw/Deposit to the customer account it needs to call the related methods or functions to execute the transactions succesfully. Or else the Transactions will not be carried out and reports an error as like missing methods or functions.
There is no such thing that methods should be always predefined in the particular classes of the application, but they can also be called using object reference which are already defined in the parent classes or interface.
2. Consider \"x\" as the total amount present in a account, and \"y\" as the interest to be applied to the existing amount.
Now we are trying to apply the interest to the existing amount ie y is being added to x => x+y
As shown above an addition operation should be performed for the account.
Hence Applyinterest method may be predefined to perform the addition operation to the customer account, and applyinterest method is required and being called by the Teller Application to perform the required Transaction.
In order to Update or Add the value to the existing value we need Deposit method or function which may defined in a particular class.
Any queries regarding are most welcome.
