Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.Scanner;
- public class Sorter
- {
- public static void main(String[] args)
- {
- Scanner keyboard = new Scanner(System.in);
- ArrayList<String> wordList = new ArrayList<String>();
- int choice = 1;
- while(choice > 0)
- {
- System.out.println("What would you like to do?");
- System.out.println("1) Enter a new list of words.");
- System.out.println("2) Display the current list of words.");
- System.out.println("3) Print the current list of words in alphabetical order. ");
- System.out.println("0) End Program.");
- choice = Integer.parseInt(keyboard.nextLine());
- if(choice < 0 || choice > 3)
- {
- System.out.print("Invalid Choice!");
- continue;
- }
- else if(choice == 1)
- {
- }
- else if(choice == 2)
- {
- }
- else if(choice == 3)
- {
- }
- }
- System.out.print("Goodbye!");
- }
- public static void getArrayList(Scanner input)
- {
- ArrayList<String> wordList = new ArrayList<String>();
- 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.");
- String addToList = input.nextLine();
- if(addToList.equals("exit"))
- {
- }
- else if(!addToList.equals("exit"))
- {
- wordList.add(addToList);
- }
- }
- public static void displayList(ArrayList<String> wordList)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment