Guest User

Problem

a guest
May 31st, 2013
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. import java.util.ArrayList;
  2. import java.util.Scanner;
  3.  
  4. public class Sorter
  5. {
  6. public static void main(String[] args)
  7. {
  8. Scanner keyboard = new Scanner(System.in);
  9. ArrayList<String> wordList = new ArrayList<String>();
  10.  
  11. int choice = 1;
  12. while(choice > 0)
  13. {
  14. System.out.println("What would you like to do?");
  15. System.out.println("1) Enter a new list of words.");
  16. System.out.println("2) Display the current list of words.");
  17. System.out.println("3) Print the current list of words in alphabetical order. ");
  18. System.out.println("0) End Program.");
  19.  
  20. choice = Integer.parseInt(keyboard.nextLine());
  21. if(choice < 0 || choice > 3)
  22. {
  23. System.out.print("Invalid Choice!");
  24. continue;
  25. }
  26. else if(choice == 1)
  27. {
  28.  
  29. }
  30. else if(choice == 2)
  31. {
  32.  
  33. }
  34. else if(choice == 3)
  35. {
  36.  
  37. }
  38. }
  39. System.out.print("Goodbye!");
  40. }
  41. public static void getArrayList(Scanner input)
  42. {
  43. ArrayList<String> wordList = new ArrayList<String>();
  44. System.out.println("Enter in a list of words followed by a press of the 'enter' key. Enter the word 'exit' to return to the menu.");
  45. String addToList = input.nextLine();
  46. if(addToList.equals("exit"))
  47. {
  48.  
  49. }
  50. else if(!addToList.equals("exit"))
  51. {
  52. wordList.add(addToList);
  53. }
  54. }
  55. public static void displayList(ArrayList<String> wordList)
  56. {
  57.  
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment