Create an inheritance hierarchy

Assignment Help JAVA Programming
Reference no: EM131586270

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
Account:SavingsAccount
Inherit from Account
additional property called interestRate (percentage assigned to account)
SavingsAccount Constructor should receive initialBalance, value for interestRate
method calculateInterest() 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, calculate the amount of interest owed to the Account using method calculateInterest(), 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.
Create Custom Exception NegativeBalanceException for the cases when user try to withdraw amount beyond available balance.

Reference no: EM131586270

Questions Cloud

Expected capital appreciation : A stock currently sells for $50 per share has a 12% expected total return and a 7% expected capital appreciation. What is the expected dividend?
Define was the police response justified : Do you feel the response was justified by the public. Was the police response justified. Why or why not. Be elaborate
How has your learning from the given experience influenced : How has your learning from this experience influenced what you will do going forward through your doctoral study process?
Annual interest rate compounded monthly : How much interest is to be paid in the second year of a 6-year loan of $100,000 with payments occurring at the end of each month, and a 6% annual interest rate?
Create an inheritance hierarchy : Create an Inheritance hierarchy that a bank may use to represent customers bank accounts - charges a fixed fee for each transaction the customer makes
Amount as in the previous question : Using the same mortgage amount as in the previous question how much higher or lower would be your monthly payment under a 15-year mortgage
Describe what sir robert peel implemented his nine principle : describe what Sir Robert Peel implemented his Nine Principles to give guidance to the newly formed New Westminster Police Service
Create a values conflict among stakeholders : In these situations, a conflict develops between the personal moral philosophy of the employees and the organization's goals or culture.
Implement classes and testing : CSE110 - Write a class definition (not a program, there is no main method) named Geek (saved in a file Geek.java) that models a person who is a geek

Reviews

Write a Review

JAVA Programming Questions & Answers

  Design and implement a small and simple email server using

design and implement a small and simple email server using the concept of web based information system. your system

  Write down a java gui application termed as indexjava that

write a java gui application called index.java that inputs several lines of text and a search character and uses string

  Assume the existence of a function copyvillian

Show how you would use the above copyVillian function to create a copy of sharpay called sharpaysMoreEvilTwin.

  Design a memory management scheme for a 48 bit architecture

Design a memory management scheme for a 48 bit architecture, using various types of paging and/or segmentation described in this week's readings

  Create system in java using agile approach

You are a software manager in company which designs critical control software for aircraft. Create system in Java using agile approach with a user involved in the development team.

  This is a simulation of rolling dice actual results

this is a simulation of rolling dice. actual results approach theory only when the sample size is large. so we will

  Write java program which can perform given types operations

Write a Java program which can perform the following types of operations based on input provided by the user: Basic mathematical calculations: addition, subtraction, multiplication and division.

  Write a java program to demonstrate the use of iterator

Write a Java program (non-GUI preferred) to demonstrate the use of Iterator.

  Construct a huffman code tree

Draw the tree that would be formed by inserting the words in this question into a binary search tree and construct a Huffman code tree. Show the initial priority queue and all changes in its state as the tree is constructed.

  Write a java program that demonstrates exception handling

For this project, you will write a Java program that demonstrates exception handling. Your program will accept from the user ten values and place those numbers in an array

  Please write the code in java

Please write the code in java for  Recursion,  Sorting and Searching

  Discuss the types of java exceptions

Discussion Question: Discuss the types of Java exceptions that can be thrown and the best ways to handle them

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