Skip to main content

Broken Code... help!

No replies
Squeoo
Offline
Joined: 2013-09-22
Points: 0

//
// The Account class has been modified by adding two instance variables containing the customer's name and account number.
// Primary constructor for the account class has three parameters: balance, customer name, and account number.
// Instance methods have been name getCustomerName and getAccountNumber with a TestAccount class to test new the new
// constructor and five new methods.

public class TestAccount {

public static void main(String[] args) {

Account acct1 = new Account(100.00, 000);

Account acct2 = new Account(200.00, 111);

Account acct3 = new Account(300.00, 222);

acct1 = acct2;

acct2.deposit(500);

acct2.setID(111);

acct3.withdraw(300);

acct3.setID(222);

public acct2.Account(String(getFirstName), String(getLastName));
firstName = Tom;
lastName = Whiten;

public acct3.Account(String(getFirstName), String(getLastName));
firstName = Mike;
lastName = More;

System.out.print( + acct1.getFirstName + acct1.getLastName);
System.out.print(" has " + acct1.getID());
System.out.print("$" + acct1.getBalance());
System.out.println(" in the bank.");

System.out.print( + acct2.getFirstName + acct2.getLastName);
System.out.print(" has " + acct2.getID());
System.out.print("$" + acct2.getBalance());
System.out.println(" in the bank.");

System.out.print( + acct3.getFirstName + acct3.getLastName);
System.out.print(" has " + acct3.getID());
System.out.print("$" + acct3.getBalance());
System.out.println(" in the bank.");

}

}