Prg420 Java Programming I

Only available on StudyMode
  • Download(s) : 712
  • Published : September 30, 2012
Open Document
Text Preview
* You are a bank manager and you are helping a new bank teller understand the kind of *
* accounts the bank offers. If a customer comes in asking to open a new savings account, the *
* teller needs to ask what kind of account—passbook savings or certificate of deposit—the *
* customer would like to open. Remind the customer that all accounts with our bank are *
* insured by the FDIC. You should explain that all accounts earn some interest; a savings *
* account’s interest is compounded monthly. You should assign a unique account number after *
* accepting the customer’s initial deposit. If the customer chooses to receive statements *
* electronically, the system will send an e-mail with a monthly statement; if the customer *
* chooses not to, then a paper statement will be sent by mail quarterly.

* If savings account is a class, give an example of each of the following as it relates to that *
* savings account. Explain your reasoning behind your example. *
Superclass
Subclass
Attribute
Method
Instance (object)
Encapsulation

Answer:
Superclass – Savings Account can be a super class. It can be used to hold the generic attributes of a savings account like account number, insured by FDIC flag etc. *
Subclass – Passbook Savings and Certificate Of Deposit can be specialized subclasses of Savings Account. A subclass inherits the capabilities of superclass and can add specialized behavior as needed. A Passbook Savings class can override the way interest is calculated if needed. A Certificate Of Deposit can add attribute for early termination fee. *

Attribute – account Number, interest Rate, electronic Statement, email Address etc. are examples of attributes present in Savings Account class *
Method – calculate Interest, send Statement, deposit, withdraw etc. are example of methods present in savings account class. *
Instance...
tracking img