Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Create an Inheritance hierarchy that a bank may use to represent customer's bank accounts (Checking and Savings).
All the bank customers can deposit (Credit) money into their account and/or withdraw (debit) money from their account.
Create necessary classes and Java application to use and test these classes.

Savings Accounts - earn interest on the money in the account.
Checking accounts - charges a fixed fee for each transaction the customer makes.
Create base class Account, with derived classes SavingsAccount and CheckingAccount that inherit from Account
Account:
contains - initialBalance
Constructors, getter/setters
validation for initialBalance,
credit() - make input is correct and positive and credit the account
debit() - make sure there is enough money, otherwise it should left unchanged
SavingsAccount
Inherit from Account
additional property called interestRate (percentage assigned to account)
SavingsAccount Constructor should receive initialBalance, value for interestRate
method find outInterest() that returns the amount of interest
CheckingAccount
Inherit from Account
additional instance variable for fee charged per transaction
Constructor should receive the initialBalance and fee amount
Should redefine debit () and credit () to take under consideration the fee charged
Now create and application that creates objects of each class to test each method. Add interest to the savingsAccount object by first invoking its caculateInterest () method, then pass the returned interest amount to the object's credit () method.
Develop a polymorphic banking application using the Account hierarchy. Create an array of Account references to SavingsAccount and CheckingAccount objects. For each account in the array, allow the user to specify an amount of money to withdraw from the account using method debit() and an amount to deposit into the account using the method deposit(). As you process each Account, determine its type. If an account is a SavingsAccount, find out the amount of interest owed to the Account using method find outInterest(), then add the interest to the account balance using method credit(). After processing an Account, print the updated balance obtained by using the getBalance() from the base class.
Interactively ask the user for information for each account and then print the result for each account. 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M987101

Have any Question?


Related Questions in Computer Engineering

Briefly explain the meaning of the t-test for regression

Briefly explain the meaning of the t-test for regression analysis. How can the "rule of two" be used to evaluate t-ratios?

Show how an avl tree can have a deepest leaf at depth 4 and

Show how an AVL tree can have a deepest leaf at depth 4 and another leaf at depth 2, and still be balanced. Show the same thing for a Red/Black tree. If there were an AVL tree and Red/Black tree with deepest leaves at de ...

Question suppose we have two binary search trees b1 and b2

Question : Suppose we have two binary search trees B 1 and B 2 Give an algorithm to merge B 1 and B 2 into a single binary search tree, and runs in time linear in the sum of the sizes of the two trees. Give good justific ...

Question the use of encryption can have adverse effects on

Question: The use of encryption can have adverse effects on incident response and incident investigations; however, from a security standpoint, encryption is a major component in network confidentiality. Present your arg ...

1 explain why fukayama thinks we are at the end of history

1. Explain why Fukayama thinks we are at the "end of history". How do you respond to his contention? 2. Explain what information a Lorenz curve gives you. How is this information summarized by a Gini coefficient. 3. Expl ...

This chart lists the estimated lengths and arrival times

This chart lists the estimated lengths and arrival times for 5 jobs. In what order do these run using FCFS? What is the average turn-around time (difference in time between a job's arrival and its completion)? In what or ...

Assignment 2 windows 8 upgradeby the due date assigned

Assignment 2: Windows 8 Upgrade By the due date assigned, submit your assignment to the Submissions Area. Scenario: You are a consultant for a company that is using Windows 7 as their operating system and are considering ...

Suppose circle is a class derived from the class point now

Suppose, Circle is a class derived from the class Point. Now consider the following statements: Point p[] = new Point[12]; P[0] = new Circle(); Now suppose Circle has a method Area() computing are of a circle, and Point ...

Answer the following question a suppose alice shares a

Answer the following Question : a. Suppose Alice shares a secret block cipher key, K_AB with Bob, and a different secret block cipher key, K_AC with Charlie. Describe a method for Alice to encrypt an m-block message such ...

1 what is the purpose of exclusive gates such as the xor

1. What is the purpose of exclusive gates such as the XOR and XNOR? 2. What function do these gates perform?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As