Hi,

I am trying to create a simple program thats reads banking information from a text file. The text file is layout out line by line. I know that there is definitley 14 lines for each customer but the amount of accounts the customer has is dependant on the 14th line of customer information, and then the amount of transactions a customer has is dependent on the 7th line (or 21st line in the text file) of accounts.

Attached is the text file and another text file explaining how its layed out.

I have been able to read upto the number of accounts a customer has but after this for example a customer could have 2 accounts with 4 transactions each or 1 account with 1 transaction.

What i would like to know is how i would read this information into the program. Would it be just one large arraylist or will i need 3 separate arraylists for Customer, accounts and transactions so i can edit and delete records.

Recommended Answers

All 3 Replies

I would create a Customer, Account and a Transaction class.
A Customer class would have a List<Account> and an Account class would have a List<Transaction>

Thanks for the reply.

At the moment i have got this (attached is the program and the text file) which reads in the first customer details. I am having a bit of trouble reading in the account details. How would i read from the 15th line in the text file as that is where the first account starts.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.