Consider developing a simple bank application as per given details. The project contains different classes. One class
Question:
- Consider developing a simple bank application as per given details.
The project contains different classes. One class is Account which is abstract. The Account class should implement following details;
List of attributes:
protected String id;
protected double balance;
Implement the following constructor:
public Account(String id, double balance) // this constructor will be used from a sub-class's constructor.
List of methods:
public String getID() // Returns the account id.
public double getBalance() // Returns the current balance.
publicabstractboolean withdraw(double amount)
publicabstract void deposit(double amount)
Second class is SavingsAccount which extends from Account. The SavingsAccount class should implement following details;
Implement the following constructor:
publicSavingsAccount(String id, double initialDeposit): // the initial deposit passed will be at least $10.
List of methods:
public void deposit(double amount): // The provided amount is added to the account
publicboolean withdraw(double amount):
Implement the withdraw method to take out the provided amount from the account balance. Incorporate the transaction fee $2 per withdrawal. A withdrawal that potentially lowers the balance below $10 is not allowed. The balance remains unchanged but the method returns false. If the withdrawal succeeds, the method returns true.
SOLVE THIS IN JAVA PROGRAMMUNG LANGUAGE.