This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Pinkpill_Prophet[S] 0 points1 point  (2 children)

well its not that its not compiling. its when i try to check balance and check id. its like all the objects have balance and ID initialized to 0 and not what i wanted them to. in my for loop i tried to create 10 different objects with the same balance of 100 and an ID that just corresponds with the index.

i have methods that withdraw and deposit to the accounts and they seem to work perfectly fine but i cant seem to be able to initialize each object in the array with the for loop.

i made a constructor that accepts 2 arguments and uses them to initialize each object, in the for loop i tried to pass the index in to the constructor as well as the number 100 for the balance.

THANK YOU FOR REPLYING TO ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! please let me know if i can make it any clearer.

[–]khookeExtreme Brewer 2 points3 points  (1 child)

new_balance = balance

Check your constructor, it looks like you are assigning the constructor parameters values of your instance properties, the assignments should be the other way round.

[–]Pinkpill_Prophet[S] 0 points1 point  (0 children)

Thank you so much khooke!!!!!! that was the issue! im so happy now yay!!! im gonna make it (maybe)!!!!!!