197k views
4 votes
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 rateAssume 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 nouns2) Refine the list to include only the necessary class names for this problem3) Identify the responsibilities of the class or classes.

User Patience
by
3.2k points

1 Answer

3 votes

Answer:

The answers are explained below

Step-by-step explanation:

1) Identify the potential classes in this problem domain be list all the nouns

class Customer

class Acco unt

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 responsibilities of the class account will be

* determination of the type of account--> Acc ount . type(char)

* deposit money into the account --> Acc ount . de posit(float)

* withdraw money into the account --> Acc ount . with draw(float)

* show balance of the account --> Acc ount . bal ance()

* generate interest --> Acc ount . int erest()

Please join the words together. I used spaces due to regulations

User Jinhua Wang
by
3.1k points