Hi,
I recently had a friends son ( that is learning java on his own) ask me to create a simple sample urban slang translator, and since its been a few years since Ive messed around with java I am running into a problem. If my memory serves me correct I remember spending hours on a project only to realize all the problems I had were something silly. Anyhow, It seems I have gotten close except that my main problem is a big one, I cant seem to get the results returned. Since he only wants to screw around with turning an application into an app saving me some hours or days would be greatly appreciated. Im sure there is an easier way, but since I've came this far now I am the curious one. Here is where I'm at thus far.
import java.util.Scanner; import java.awt.*; import java.util.*; public class Slang { public static void main(String[] args) { String[][] translateList = {{"a long time", "a minute"}, {"opinion", "two cents" }, {"dance", "two step"}, {"attractive", "all that"}, {"leave", "audi"}, {"yes", "awe yeah"}, {"no", "awe naw"}, }; Scanner scan = new Scanner(System.in); System.out.println ( "convert it to slang" ); String sentence = scan.nextLine(); String[] input = sentence.split("\\s"); for (int x=0; x<input.length; x++) { for (int y = 0; y < translateList.length; y++) if (input[x].equalsIgnoreCase(translateList[y][0])) System.out.println("True"); } } }