When I try to call the balance method I get the error below.I am trying to list the account holder with their account balance. Any help would be great.
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
public void balance(){
for (int x = 0; x < 6; ++x)
if (x < 5){
Console.WriteLine("Account Holders Name===>{1}Has a balance of===>{2}",
accountname[x], accountbal[x]);
}
}
Format argument indices start at 0, not 1. Try this: