package lyrics;

import java.awt.Component;
import java.util.*;
import javax.swing.JOptionPane;

public class checkinLyrics {
    private static Component frame;

    public static void main(String[] args) {
        JOptionPane.showMessageDialog(frame, "Welcome to the lyrics checker!");
        String lyrics = asker();
        String[] words = taboo();

        System.out.println("Your lyrics are: " + lyrics);
        System.out.println(plural(words));
    }

    // TODO in other method, make the inputs toUpperCase();
    public static String asker() {
        String allLyrics = JOptionPane.showInputDialog(frame, "Please input the song lyrics:");
        return allLyrics;
    }

    public static String[] taboo() {
        String theWord = JOptionPane.showInputDialog(frame, "What word are you looking for?");
        // TODO fix this method so it's smoother
        int i = 1;
        String[] wordArr = new String[1];
        wordArr[0] = theWord;
        String[] listWords = Arrays.copyOf(wordArr, wordArr.length);
        do {
            theWord = JOptionPane.showInputDialog(frame, "Is there another word? Type \"END\" to stop.");
            listWords = Arrays.copyOf(listWords, listWords.length + 1);
            listWords[i] = theWord;
            i++;

        } while (theWord.equals("END") == false);
        String[] finalArray = Arrays.copyOf(listWords, listWords.length - 1); // takes off the END entry. not very
                                                                              // elegant.
        /*
         * println's checking if you got the right arrays
         * System.out.println(Arrays.toString(finalArray));
         * System.out.println(Arrays.toString(listWords));
         */
        return finalArray;
    }

    public static String turnToString(String[] arr) {
        String hi = "";
        for (int i = 0; i < arr.length; i++) {
            hi = hi + arr[i] + " ";
        }
        System.out.println(hi);
        return hi;
    }
    
    public static String plural(String[] arr) {
        String turned = turnToString(arr);
        if (arr.length <2) {
            return "The word you're looking for is: " + turned;
        }
        return "The words you're looking for are: " + turned;
    }
}

@@ -470,60 +470,176 @@
 );%0D%0A
+%0D%0A
     
-%7D%0D%0A%0D%0A    // TODO in other
+    System.out.println(%22Now performing lyrics search...%22);%0D%0A        // String searcher = search(lyrics, words);%0D%0A        // TODO make a search
  method
-, make
  th
-e input
+at include
 s to
@@ -647,19 +647,25 @@
 pperCase
-();
+%0D%0A    %7D%0D%0A
 %0D%0A    pu
@@ -1274,20 +1274,21 @@
 rd? 
-Type %5C%22END%5C%22
+Enter nothing
  to 
@@ -1456,32 +1456,93 @@
 ord.
-equals(%22END%22) == false);
+length() != 0);%0D%0A        // TODO add something for if the user inputs an empty string
 %0D%0A  
@@ -2224,20 +2224,16 @@
 %0A    %7D%0D%0A
-    
 %0D%0A    pu
@@ -2343,16 +2343,17 @@
 length %3C
+ 
 2) %7B%0D%0A  
@@ -2441,24 +2441,43 @@
  return %22The
+ %22 + arr.length + %22
  words you'r

Update checkinLyrics.java