|
OK I will try your code,
I do think I go tit working with this, Im not 100% sure but I am getting no errors let me know what you think,
In the begining the getAcount method looked like this,
public coldbeveragejava.Account getAcount(int accountID) {
return null;
}
I needed to change it so it took the accountID and checked it against the accounts that already existed, Note that a user can only enter a 1 or a 2 and both these accountID's already exist in the array,
Here is what I modified the code to
public coldbeveragejava.Account getAcount(int accountID) {
// loop through accounts searching for matching account number
for ( Account currentAccountID : accounts )
{
// return current account if match found
if ( currentAccountID.getAccountNumber() == accountID )
return currentAccountID;
}
return null;
}
Its getting no errors and it seems to work.
|