Hi,
I'm currently learning Java, and I've been given a task to output an instance of an Account ADT, several times with different data.
So far I've managed to get almost everything working, except a boolean method.
I have been told to use a boolean for the [b]withdraw[/b] method.
My main:
[code]
public class TestAccount
{
public static void main (String[] arg)
{
Account myaccount = new Account ();
myaccount.deposit(50.00);
printAccount(myaccount);
myaccount.withdraw(50.00);
printAccount(myaccount);
myaccount.deposit(50.00);
printAccount(myaccount);
myaccount.withdraw(50.01);
}
public static void printAccount (Account a)
{
System.out.println ("Account Number: "+ a.getAccountNumber());
System.out.printf ("Balance:
Comments
Your withdraw takes a double as a parameter and you supply it with nothing there.