Question 0-3

The following program uses the Account class we defined in class.

import csbsju.cs160.*;

public class PrintHello {
    public static void main(String[] args) {
        Account a = new Account();
        Account b = new Account();
        a.deposit(81.0);
        b.withdraw(3.0);
        a = b;
        a.deposit(9.0);
        b = new Account();
        b.withdraw(1.0);
        IO.println(a.getBalance());
    }
}
What does this program print?

Solution

6.0

Back to Review for Midterm 0