Please HELP!
I have to input data from a text file into an array. I also must be able to edit this data such as remove an object, add an object, find an object etc.
For example:
ID Name Salary
923948290 Lucas Kleins 30.000
293589435 Ricardo Silva 23.000
891345013 John Reid 30.000
901394503 Jose Jack 23.000
913453498 Joe Geui 24.000
How can I input this and be able to find the indexes?
Feeding an array from a text file.
Page 1 of 18 Replies - 160 Views - Last Post: 04 October 2012 - 01:18 PM
Replies To: Feeding an array from a text file.
#2
Re: Feeding an array from a text file.
Posted 03 October 2012 - 04:22 PM
What code do you currently have? What have you tried? What are you stuck on (other than all of it, that doesn't count as an answer)?
#3
Re: Feeding an array from a text file.
Posted 03 October 2012 - 04:24 PM
If those are your requirements, an array is not appropriate. Use a List of (say) Employee objects
#4
Re: Feeding an array from a text file.
Posted 03 October 2012 - 04:30 PM
I must use arrays, I have to have an abstract class and create methods myself to accomplish these tasks. I just want an overview of how i should start.
I already have classes set up with constructors and mutator methods.
I already have classes set up with constructors and mutator methods.
#5
Re: Feeding an array from a text file.
Posted 03 October 2012 - 04:34 PM
Then create Employee[]. You can either 'remove' by setting elements to null or creating a new one and copying elements
#6
Re: Feeding an array from a text file.
Posted 03 October 2012 - 05:18 PM
where is the best place to read about this topic?
#7
Re: Feeding an array from a text file.
Posted 03 October 2012 - 05:28 PM
I pretty much have to create my own arraylist from using arrays which uses text file.
#8
Re: Feeding an array from a text file.
Posted 04 October 2012 - 04:06 AM
Quote
I pretty much have to create my own arraylist from using arrays
Well, then you need to do what i suggested earlier and resize the array as needed. Start by making the Employee class
#9
Re: Feeding an array from a text file.
Posted 04 October 2012 - 01:18 PM
ok ill try that thanks
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|