Question: JAVA Write an Account Class that implements the interface AccountInterface. public interface AccountInterface { / * * * Deposits the specified amount into the account.

JAVA
Write an Account Class that implements the interface AccountInterface.
public interface AccountInterface {
/**
* Deposits the specified amount into the account.
* Returns the new balance.
* @param amount
* @return
*/
public double deposit(double amount);
/**
* Withdraws the specified amount from the account and applies the fee.
* Returns the new balance.
* @param amount
* @param fee
* @return
*/
public double withdraw(double amount, double fee);
/**
* Withdraws the specified amount from the account.
* Returns the new balance.
* @param amount
* @return
*/
public double withdraw(double amount);
/**
* Add the interests to the account and returns the new balance.
* The default interest rate is 0.0435(4.55%)
* return the new balance
*/
public double addInterest();
/**
* Increases the account balance by 1 and returns the new balance
* @return
*/
public double increment();
/**
* Decreases the account balance by 1 and returns the new balance
* @return
*/
public double decrement();
/**
* Returns the owner of the account.
* @return
*/
public Person getOwner();
/**
* Returns the account number of the account.
* @return
*/
public long getAcctNumber();
/**
* Returns the current balance of the account.
* @return
*/
public double getBalance();
}
The Account class should have the following fields
owner: Person
RATE: double // This should have a value of 0.0435
balance: double
acctNumber: long
In addition to the methods being inherited from the AccountInterface, the Account class should also have the following constructor:
public Account(Person owner, long acctNumber, double initialBalance)
You will be able to add any helper methods to your Account class.
You also need to create getters and setters for the above fields.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!