2. Question 3 from Algorithm Workbench: 3. Look at the following description of
ID: 3739217 • Letter: 2
Question
2. Question 3 from Algorithm Workbench: 3. Look at the following description of a problem domain: The bank offers the following types of accounts to its customers: savings accounts checking accounts, and money market accounts. Customers are allowed to deposit money into an account (thereby increasing its balance), withdraw money from an account (thereby decreasing its balance), and earn interest on the account. Each account has an interest rate. Assume that you are writing a program that will calculate the amount of interest earned for a bank account a. Identify the potential classes in this problem domain. b. Refine the list to include only the necessary class or classes for this problem. c. Identify the responsibilities of the class or classes.Explanation / Answer
a.The potential classes could be found in the description.For the above problem, the classes can be the following
b.If we are to refine the list to include only the necessary class,then Customer would be the class needed.
c.The Customers class reponsibilities include the type of account they are depositing the money into.
The remaining classes SavingsAccount,CheckingAccount,MoneyMarketAccount will have the information regarding the amount deposited and also the interest calculating methods.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.