Look at the following description of a problem domain: The bank offers the follo
ID: 3761881 • Letter: L
Question
Look at the following description of a problem domain:
The bank offers the following types of accounts to its customers: saving 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 will write the code for an application that will calculate the amount of interest earned for a bank account.
Use word document to answer the following questions:
1) Identify the potential classes in this problem domain be list all the nouns
2) Refine the list to include only the necessary class names for this problem
3) Identify the responsibilities of the class or classes.
Explanation / Answer
1) Identify the potential classes in this problem domain be list all the nouns
class Customer
class Account
2) Refine the list to include only the necessary class names for this problem
the class customer is not necessary to solve the problem itself, therefore the only class could be the account class
3) Identify the responsibilities of the class or classes.
The responsabilities of the class account will be
* determination of the type of account--> Account.type(char)
* deposit money into the account --> Account.deposit(float)
* withdraw money into the account --> Account.withdraw(float)
* show balance of the account --> Account.balance()
* generate interest --> Account.interest()
/***********************************************************
if you have any question about it please leave me a comment
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.