Results 1 to 2 of 2
Thread: Interactive Program
- 06-03-2012, 02:23 AM #1Member
- Join Date
- Jun 2012
- Rep Power
Alrighty. I'm new to Java.
I'm trying to write a program that begins by taking an optional command line argument, which is the name of a file.
The format of this file is a list of persons' names, one per line.
The program will read these names and store them in an array.
If no command line argument is given, the program will simply create an empty array, used to store names.
The program will then proceed to sort the list of names using selection sort (if the array is not empty). Finally, there will be a menu of options for the user to select from.
The first is to alphabetize the list.
Second, an option to find a particular name matching a keyword provided by the user. This should use "binary search". For example, the user could provide the keyword Davis, and if the list contains the name James Davis, the program will return this name. The program is required to return only the first ocurrence found if there's more than one.
Third, the user could add a name to the list
Fourth, terminate the program
I'm using Eclipse, so if you could put the code in terms of Eclipse, that would be great.
So far, I have a couple algorithms for binary search, selection sort, and a non-functional menu.
- 06-03-2012, 02:43 AM #2
- By ali_sakar in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 01-04-2012, 02:50 PM
- By seanfmglobal in forum New To JavaReplies: 1Last Post: 11-29-2010, 01:06 AM
- By richi_arora_ra in forum Web FrameworksReplies: 0Last Post: 11-19-2010, 01:26 PM
- By teckygamer in forum AWT / SwingReplies: 0Last Post: 09-06-2010, 12:43 PM
- By homistar in forum Java 2DReplies: 4Last Post: 10-06-2009, 09:16 AM