/** * This class performs various operations on variables of type * BankAccount * @author CS161 * @version Fall 16 */ public class Transactions { public static void main(String[] args){ BankAccount myCheckingAccount = new BankAccount("Nalin", 500.00); BankAccount mySavingsAccount = new BankAccount("Nalin", 2000.00); System.out.println(myCheckingAccount.toString()); System.out.println(mySavingsAccount.toString()); System.out.println(); // Nalin gets paid for the month of Sept System.out.println("Got paid"); myCheckingAccount.deposit(200.00); System.out.println(myCheckingAccount.toString()); System.out.println(); // Nalin goes out to eat at a restaurant with friends System.out.println("Went out to eat"); myCheckingAccount.withdraw(100.00); System.out.println(myCheckingAccount.toString()); System.out.println(); // Checking getting a little low... System.out.println("transferred to checking"); mySavingsAccount.transfer(myCheckingAccount, 100.00); System.out.println(myCheckingAccount.toString()); System.out.println(mySavingsAccount.toString()); } }