I am trying to create a simple banking system that reads in data from a text file.
Attached is a copy of the text file and another text file explaining the layout.
How would i read this information in. I need a class for customers, accounts and transactions and an arraylist to store the information.
What i know is that the customer class will have 14 items in it. However what confuses me is that a customer could have 2,3 or more accounts with a handful of transactions on each account. How would i read this information in.
There are about 3 different record types in the file: customer, account, and transaction. The instructions tell you that each record type is a fixed length and that there is a field that tells you the number of records.
Customer contains Account which contains Transactions. So the Customer record will contain a field that tells you how many account records to read. Each account record will tell you how many transactions for that account.
Starting at the beginning of the file you read the first account record info line by line until you get to the #0f accounts field you put that into a Customer class object, then given the #ofaccounts, you start reading them into Account class objects until you hit the #oftrans and then start reading the transactions and so on.
You'll have to create objects of each type with properties and create the objects and set the properties.
How would i tell it to start reading from the right point and tell it to stop reading when it reaches the end of accounts.
Because each record type is a fixed length and each record type has a count of the next record, all you need to do is keep track of the number of lines to read.
I have got this at the moment. However the transaction output seems to output only the last transaction for the customer. I think it goes through to the end and overwriting the previous transactions. How do i stop it from over writing and returning each transaction loop.
Attached is a zip of my program so far. (The list box and button is used just so i can see what is happening).
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.