Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Java project to simulate a bank account. All the classes should match the attached class contracts. You need to implement all the classes

Create a Java project to simulate a bank account. All the classes should match the attached class contracts. You need to implement all the classes with their corresponding properties and methods.

The Account class should have methods to set interest rate, apply interest, deposit and withdraw funds as well as getter and setters methods for their properties as shown in the class contract. The creationDate property is set in the class constructor. The SavingsAccount class should inherit from Account. It should override the withdraw method from its superclass by preventing overdrafts (balance should never go below zero). The CheckingAccount class should inherit from Account. It should have a property for overdraft limit with a default amount of 100 (create a constant for that) but any positive amount should be allowed. It should also have a withdraw method, which should override that of its super class by making sure than the balance never goes below the overdraft limit.

Student extra work: Enhance the CheckingAccount class to allow clearance and deposit of checks. To do that, you need to implement an ArrayList of Checks and have methods to deposit, clear and display checks as well as to implement the check class. Check class. This class should have properties for number, rountingNumber, date, amount and bankName. All those properties should be set in the class' constructor and the class should include getters methods. Finally, you should have a tester class to test deposit and clearance of checks. A sample run as well as sample test data is attached.

image text in transcribedimage text in transcribed

image text in transcribed

image text in transcribed

OUTPUT SHOULD LOOK LIKE THIS

image text in transcribed

AccuntjieCheck jova CheckingAccount.java X. D savingsAccount.java D AccountTester.java import java.util.*; public class CheckingAccount extends Account double overdraftLimit: final double DEFAULT OVERDRAFT LIMIT100: ArrayList checksDeposited, checksCleared; int lastCheckCleared; public CheckingAccount (String bankName-, String actNumber-, String actName-, double balance-, public CheckingAccount) public void withdraw (double amt) public void depositCheck (Check newCheck) public void clearCheck (Check newCheck) public void displayAlichecks() + P D Accountjava CheckjavakngAccountjava DSavingsAccountjava DAccount Testerjava public class SavingsAccount extends Account f public savingsAccount (String bankName , String actNumber , String actName , double balance , double annual InterestRate ) { public SavingsAccount ) 0 A public void withdraw (double amt) Enter bank name: Grizzly Bank Enter account number, account name (no spaces), initial balance, annual interest rate (in decimals) and overdrait limit: 283-BC8273-1934 GrizzlyChecking 0 1.05 100 = Checks Deposited Enter check number, routinq number, amount, date (mm/dd/yyyy) and bank name Enter 0 (zero) to finish 100 262141335 150 01/05/2016 Atlanta Georgia Bank 230 262541395 352.91 01/09/2016 Fidelity Bank 1090 282511394 854.87 01/12/2016 American National Bank - Checks Cleared - Enter check number, amount, date (MM/dd/yyyy) . Enter 0 (zero) to finish 1001 62.14 02/08/2016 1002 82.17 02/08/2016 1003 43.79 02/08/2016 1004 91.36 02/08/2016 Transaction History - -- Summary for GrizzlyChecking -- Checks Deposited Number Amount Bank Name 150.00 Atlanta Georgia Bank Bank Routing Number 262141335 262541395 282511394 Date 100 01/05/16 230 01/09/16 352.91 Fidelity Bank 1090 01/12/16 854.87 American National Bank Total deposited: $1,357.78 = Checks Cleared ==== Number Date 100102/08/16 100202/08/16 100302/08/16 100402/08/16 Amount 62.14 82.17 43.79 91.36 Total cleared: $279.46 Current balance: $1,078.32 AccuntjieCheck jova CheckingAccount.java X. D savingsAccount.java D AccountTester.java import java.util.*; public class CheckingAccount extends Account double overdraftLimit: final double DEFAULT OVERDRAFT LIMIT100: ArrayList checksDeposited, checksCleared; int lastCheckCleared; public CheckingAccount (String bankName-, String actNumber-, String actName-, double balance-, public CheckingAccount) public void withdraw (double amt) public void depositCheck (Check newCheck) public void clearCheck (Check newCheck) public void displayAlichecks() + P D Accountjava CheckjavakngAccountjava DSavingsAccountjava DAccount Testerjava public class SavingsAccount extends Account f public savingsAccount (String bankName , String actNumber , String actName , double balance , double annual InterestRate ) { public SavingsAccount ) 0 A public void withdraw (double amt) Enter bank name: Grizzly Bank Enter account number, account name (no spaces), initial balance, annual interest rate (in decimals) and overdrait limit: 283-BC8273-1934 GrizzlyChecking 0 1.05 100 = Checks Deposited Enter check number, routinq number, amount, date (mm/dd/yyyy) and bank name Enter 0 (zero) to finish 100 262141335 150 01/05/2016 Atlanta Georgia Bank 230 262541395 352.91 01/09/2016 Fidelity Bank 1090 282511394 854.87 01/12/2016 American National Bank - Checks Cleared - Enter check number, amount, date (MM/dd/yyyy) . Enter 0 (zero) to finish 1001 62.14 02/08/2016 1002 82.17 02/08/2016 1003 43.79 02/08/2016 1004 91.36 02/08/2016 Transaction History - -- Summary for GrizzlyChecking -- Checks Deposited Number Amount Bank Name 150.00 Atlanta Georgia Bank Bank Routing Number 262141335 262541395 282511394 Date 100 01/05/16 230 01/09/16 352.91 Fidelity Bank 1090 01/12/16 854.87 American National Bank Total deposited: $1,357.78 = Checks Cleared ==== Number Date 100102/08/16 100202/08/16 100302/08/16 100402/08/16 Amount 62.14 82.17 43.79 91.36 Total cleared: $279.46 Current balance: $1,078.32

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions