Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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 

Java, Programming

  • Category:- Java
  • Reference No.:- M9117700

Have any Question?


Related Questions in Java

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

  • 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