Skip to content

Instantly share code, notes, and snippets.

@hugotai101
Created October 20, 2017 14:37
Show Gist options
  • Save hugotai101/2340f038c17881edee657573cb52da08 to your computer and use it in GitHub Desktop.
Save hugotai101/2340f038c17881edee657573cb52da08 to your computer and use it in GitHub Desktop.
public class PhraseOMatic3 {
public static void main(String[] args) {
String[] girls = {"Amanda", "Jessica", "Chrissie"};
String[] verbs = {"loves", "hates"};
String[] boys = {"Andy", "Aaron", "Eason", "Jacky"};
for (String girl : girls) { // for each string in girls[]
int j = (int) (Math.random() * verbs.length);
int k = (int) (Math.random() * boys.length);
System.out.println(girl + " " + verbs[j] + " " + boys[k]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment