The user must enter an arbitrary amount of nouns and adjectives in 2 different arrays.(Minimum of 3 per array). Example array A users enters apple, pair, orange. Array b = green, sweet, rotten, blue. Now I need to randomly pick the adjectives and add them to the nouns. Like Sweet apple, rotten pair etc... I can't use the same word twice and I need to use the math.Random(). How can you do this?
public static void main(String[] args) {
String[] Noun = new String[4];
String[] Adj = new String[4];
int numbOfNouns = 0;
int numbOfAdj = 0;
Scanner kb = new Scanner(System.in);
System.out.println("How many nouns ? min 3");
numbOfNouns = kb.nextInt();
while (numbOfNouns < 3) {
System.out.println("How many nouns ? min 3");
numbOfNouns = kb.nextInt();
}
System.out.println("Enter " + numbOfNouns + " nouns");
for (int i = 0; i <= numbOfNouns; i++) {
Noun[i] = kb.nextLine();
}
System.out.println("How many adjectives ? min 3");
numbOfAdj = kb.nextInt();
while (numbOfAdj < 3) {
System.out.println("How many adjectives ? min 3");
numbOfAdj = kb.nextInt();
}
System.out.println("Enter " + numbOfAdj + " adjectives");
for (int i = 0; i <= numbOfAdj; i++) {
Adj[i] = kb.nextLine();
}
}