Suppose you are given a class named BankAccount
with the following contents:
// A BankAccount keeps track of a user's money balance and ID, // and counts how many transactions (deposits/withdrawals) are made. public class BankAccount { private String id; private double balance; private int transactions; // Constructs an object with the given id/balance and 0 transactions. public BankAccount(String id, double balance) public double getBalance() public String getID() public String getTransactions() // Adds amount to balance if between 0-500. Also counts as 1 transaction. public void deposit(double amount) // Subtracts amount from balance if user has enough money. Counts as 1 transaction. public void withdraw(double amount) ... }