Write the interest bearing account interface

Assignment Help Basic Computer Science
Reference no: EM131661914

Question: Consider the following five classes: Bank, Account, NonInterestCheckingAccount, InterestCheckingAccount, and PlatinumCheckingAccount, as well as an interface called InterestBearingAccount which interact as follows:

- A Bank stores an ArrayList that can contain accounts of all types, including savings and checking accounts, some of which are interest bearing and some of which are not. Bank contains a method called totalAssets that returns the sum of all the balances in all the accounts. It also contains a method called addInterest that invokes the addInterest method for all the accounts in the bank that are interest-bearing.

- Account is an abstract class. Each account stores the name of the account holder, an account number (sequentially assigned automatically), and the current balance, along with an appropriate constructor to initialize these data members, and methods to access the current balance, add to the current balance, and subtract from the current balance. NOTE: All these methods are implemented in the Account class, so even though Account is abstract, none of the methods that you are implementing in this class are abstract.

- The InterestBearingAccount interface declares a single method addInterest (no parameters, void return type) that increases the balance by the interest rate that is appropriate for the particular account.

- An InterestCheckingAccount is an Account that is also an InterestBearingAccount. Invoking addInterest increases the balance by 3%.

- A PlatinumCheckingAccount is an InterestCheckingAccount. Invoking addInterest increases the balance by double the rate for an InterestCheckingAccount (whatever that rate happens to be).

- A NonInterestCheckingAccount is an Account but it is not an InterestBearingAccount. It has no additional functionality beyond the basic Account class.

For this question, do the following. You do not have to provide any functionality beyond the specifications above:

a. Five of the six classes above form an inheritance hierarchy. For those five classes, draw the hierarchy. b. Implement Account.

c. Implement NonInterestCheckingAccount.

d. Write the InterestBearingAccount interface.

e. Implement Bank.

f. Implement InterestCheckingAccount.

g. Implement PlatinumCheckingAccount.

Reference no: EM131661914

Questions Cloud

What is a parameterized query : What is a parameterized query, and why would you want to use one to retrieve data from a database for a web application?
Advantages and disadvantages of utilizing cidr : Research using the course learning materials, valid internet sources, and related personal experience, the advantages and disadvantages of utilizing CIDR.
Identifying patients needs and analysis details : The focus of this assignment is identifying patient's needs and analysis and synthesis of details within the written client record
Discuss about permanent and temporary book-tax differences : What is the difference between permanent and temporary book-tax differences
Write the interest bearing account interface : Consider the following five classes: Bank, Account, NonInterestCheckingAccount, InterestCheckingAccount, and PlatinumCheckingAccount, as well as an interface.
Placement of parentheses in an algebraic expression : Implement a program that will use a stack structure to check for correct placement of parentheses in an algebraic expression.
Directory display commands indos : What is the purpose of supporting two directory display commands inDOS? Which command is more useful, TREE or DIR?
Purpose of supporting two directory display commands : What is the purpose of supporting two directory display commands inDOS? Which command is more useful, TREE or DIR?
How the comfort of the helmets impacts the use of helmets : How the comfort of the helmets impacts the use of child helmets in bicycles

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Price and quantity of hershey krackle

What happens to price and quantity of Hershey Krackle bars when there is an increase in the price of rice and an increase in the price of light bulb? (Hershey Krackle bars made with chocolate and crisped rice)

  Write a program that executes a command and then displays it

Write a program that executes a command and then displays its resource usage

  Services that contributed to the growth

Government purchases for the year 1984 plus 5 years and compare to Dec 2013. Name 2 events/products/ services that contributed to the growth.

  Study how the predictor parameters vary

Study how the predictor parameters vary. If they converge and do not vary much after a while, test the resulting constant values as control parameters.

  Find the posterior distribution of µ

find a 95% credible interval for the true μ; and (c) find the probability that the posterior mean math SAT score is greater than 600.

  Use the heuristic evaluation method

For this coursework you must provide an Expert Appraisal of the Just Eat's takeway interface (web or mobile app) (http://just-eat.co.uk) in a web browser or phone of your choice.

  How much would it be to beef

How much would it be to beef the answers up another 100 -150 words per answer.

  Goals of system monitoring urban weather and pollution

What goals would you have for the system besides monitoring urban weather and pollution? What legal and ethical concerns should you understand prior to deploying the network?

  Evaluate exp1 then exp2 and return the value of exp2

If exp1 has no side effects (assignments, I/O or system calls) it need not be evaluated at all. How can we test exp1's AST, prior to code generation, to see if we can suppress its evaluation?.

  Determine the data items and methods

Determine the data items and methods that would be useful for a class used for simulating tossing a single die. Choose your own class name and data item names.

  Compare a filtering firewall to a proxy firewall

Compare a filtering firewall to a proxy firewall in terms of protection against spoofing attacks,. Assume a configuration as in Figure 8.21, where the internal host under attack trusts the remote company user.

  How can it workers find out what happened

How can IT workers find out what happened? What tools are available to them to investigate the issue and be sure it does not recur?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd