-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhraseOMatic.java
More file actions
32 lines (24 loc) · 1.27 KB
/
Copy pathPhraseOMatic.java
File metadata and controls
32 lines (24 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import java.util.Random;
public class PhraseOMatic {
public static void main (String[] args) {
String[] wordListOne = {"agnostic", "opinionated","voice activated", "haptically driven", "extensible","reactive",
"agent based", "functional", "AI enabled","strongly typed"};
String[] wordListTwo = {"loosely coupled", "six sigma","asynchronous", "event driven", "pub-sub", "IoT",
"cloud native", "service oriented", "containerized", "serverless","microservices", "distributed ledger"};
String[] wordListThree = {"framework", "library","DSL", "REST API", "repository", "pipeline", "service mesh",
"architecture", "perspective", "design","orientation"};
//lets find out how many words are in each list
int oneLength = wordListOne.length;
int twoLength = wordListTwo.length;
int threeLength = wordListThree.length;
// generate three random numbers
Random randomGenerator = new Random();
int rand1 = randomGenerator.nextInt(oneLength);
int rand2 = randomGenerator.nextInt(twoLength);
int rand3 = randomGenerator.nextInt(threeLength);
// now build a phrase
String phrase = wordListOne[rand1] + " " + wordListTwo[rand2] + " " + wordListThree[rand3];
// print out the phrase
System.out.println("What we need is a " + phrase);
}//end main
}//end