Question: use Java class D extends C 14. Given the following interface: (21 pts) public interface Walletlnterface ( public double getBalance(): public void addMoney(double amount); public

 use Java class D extends C 14. Given the following interface:(21 pts) public interface Walletlnterface ( public double getBalance(): public void addMoney(double

use Java

class D extends C 14. Given the following interface: (21 pts) public interface Walletlnterface ( public double getBalance(): public void addMoney(double amount); public double spendMoney(double amount); public String toStringl): Write three classes named APerson, Wallet, and BankAccount. The person class should have name, iD, Wallet, and BankAcount as private members. The wallet class should have a private double amount member and implements Walletinterface The BankAcount should have the balance, account number as its private members. Write constructor, setters, getters and toString() for all three classes. In a person constructor Create Object of BankAcount with initial balance of 100.0 dollars. Create Object of Wallet as well. Provide methods (API) to help the user of you classes to do their job as follows: (see main) public class Driver 9 public static void main(String I ] args) APerson lisa new APerson ("Lisa","1111"); APerson jack new APerson("Jack", "2222"); / / check the lisa Wallet if it has no money, withdraw, 20 dollar from her bank, add to her wallet. // print the result using toString) // do the same for Jack except withdraw 40 dollar, print the result. // Write statement to see which one Lisa or Jack has more money

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!