Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Help with boolean method.

ExigeExige Member Posts: 2
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

Sign In or Register to comment.