Results 1 to 3 of 3
- 04-07-2009, 12:01 AM #1
Member
- Join Date
- Apr 2009
- Posts
- 17
- Rep Power
- 0
[SOLVED] Array element not found!
In this program I can compile it and run it fine except for the fact that when I want to make changes it only makes changes to whatever is in parallelArray[0]
Here is the link to the code:
lin(dot)cr/hwx
I can create an account just fine, it's just when I deposit money into the second,third,fourth,etc. account.
My output looks like this from the code(I just used random names):
* You selected: Create Account
Yksfjdkl, Afjhsdjfh
Account Number: A4326-YA-3206-KF-66572424 created!
Account Balance: $0.0
Credit Limit: $100.0
* You selected: Create Account
Gks;dfk, Hdfsljhkl
Account Number: A4326-GH-8944-KD-47386522 created!
Account Balance: $0.0
Credit Limit: $100.0
* You selected: Deposit
DEBUG: *A4326-YA-3206-KF-66572424* == *A4326-YA-3206-KF-66572424* is true
DEBUG: found!!!
Account to deposit to: A4326-YA-3206-KF-66572424
Amount to deposit: 600.0
600.0 deposited to: A4326-YA-3206-KF-66572424
* You selected: Deposit
DEBUG: *A4326-GH-8944-KD-47386522* == *A4326-YA-3206-KF-66572424* is false
DEBUG: *A4326-GH-8944-KD-47386522* == ** is false
DEBUG: *A4326-GH-8944-KD-47386522* == ** is false
DEBUG: *A4326-GH-8944-KD-47386522* == *null* is false
- 04-07-2009, 04:47 AM #2
Senior Member
- Join Date
- Dec 2008
- Location
- Hong Kong
- Posts
- 473
- Rep Power
- 5
problem seems use repeatedly use "i" in the function
...
found in beginning of for loop, if you make deposit to account 0, i set to 0,Java Code:accountNumber[i] = "";
for next loop, accountNumber[i] reset to ""....
program logic... i think initialization should do first...
for operation... while loop use instead of for loop...
because... i think i can make deposit to the same account more than 1000 times...Last edited by mtyoung; 04-07-2009 at 04:52 AM.
- 04-07-2009, 07:25 AM #3
Member
- Join Date
- Apr 2009
- Posts
- 17
- Rep Power
- 0
Similar Threads
-
[SOLVED] indexing an element in an array help!
By anthonym2121 in forum New To JavaReplies: 1Last Post: 04-03-2009, 06:21 PM -
How to add an integer to a array element and the store that backinto an array.
By Hannguoi in forum New To JavaReplies: 1Last Post: 03-31-2009, 06:40 AM -
adding list to an array element
By Preethi in forum New To JavaReplies: 5Last Post: 09-25-2008, 04:23 AM -
Unique element in an array
By revathi17 in forum New To JavaReplies: 2Last Post: 12-31-2007, 08:44 AM -
Max element in an Array
By mew in forum New To JavaReplies: 5Last Post: 12-03-2007, 05:26 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks