| Author |
Help: Read file, get #, set arry size, display #s,etc.
|
Cain Silverbane
Greenhorn
Joined: Jul 22, 2002
Posts: 13
|
|
Ok, here is the deal. I am getting ready for a test and trying to practice stuff, so the prof. gave me a lab. It is supposed to basically use a filename as a command line argument, read the #s in, and print them out in a neat 5 column style. The #s are supposed to be sorted first, lowest to highest [without using arrays.sort()]. Also, the first # in the file needs to be set to the array length. He said to use Integer.toString() for spacing, and to make a reusable file-sorting object. He also is letting us use a LineFilter class that we have made before in class (see below). If anyone can throw some code to give me an idea how to do it / start, I would appreciate it.
|
~ Silverbane ~
|
 |
Cain Silverbane
Greenhorn
Joined: Jul 22, 2002
Posts: 13
|
|
|
Hmm... still not getting anywhere. We are supposed to make LineFilter private and then create a main to do various things, as well as other methods... basically get the numbers from a file, sort em, print em... Ack.
|
 |
Dirk Schreckmann
Sheriff
Joined: Dec 10, 2001
Posts: 7023
|
|
|
Which part(s) of the assignment are you having difficulty with? What have you tried so far?
|
[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
|
 |
Cain Silverbane
Greenhorn
Joined: Jul 22, 2002
Posts: 13
|
|
|
One of the main things Im having trouble with is getting the first number to be the size of the array, and the others to go into the array. A sorting method should be simple enough, and getting the display isn't worrying me too much.
|
 |
 |
|
|
subject: Help: Read file, get #, set arry size, display #s,etc.
|
|
|