subject

In this problem, you will write three methods to:
1) Create a string array containing permutations of strings from two String array parameters.
2) Concatenate three String arrays using the method from part (a).
3) Print a String array, using an enhanced for loop (for-each).
For the examples given below, first is an array of first names, middle is an array of middle names, and last is an array of last names.
Assume that ALL names are different.

(a) Write the method makeNames that creates and returns a String array of new names based on the method's two-parameter arrays, array1 and array2.
The method creates new names in the following fashion: for each string in array1, concatenate a String from array2. Add a character space between the two strings:
array[i] + " " + array2[j]

In the example below the array names contains 20 names including "David A", "David B", "David C",..., "Lucy E".

String[] first = {"David", "Mike", "Katie", "Lucy" };
String[] middle = "A", "B", "C", "D", "E");
String[] names = makeNames (first, middle);

If one of the parameter arrays has size 0, return the other parameter array.
In the example below the array names contains 4 names: "David", "Mike", "Katie", "Lucy".

String[] first = {"David", "Mike", "Katie", "Lucy" };
String[] middle = {};
String names = makeNames (first, middle);

Use the method header:
public static String[] makeNames (String[] arrayı, String[] array2)

(b) Write an overloaded method makeNames that creates and returns a new String array of new names based on three input String arrays. makeNames will make new names using the method from part (a) without using loops. Each element in the returned array will be a concatenation of three strings: a string from the first parameter, a string from the second parameter, and a string from the third parameter.
In the example below the array names contains 40 names including "David A Green", "David B Green", "David C Green", ..., "Lucy E Wong".

String[] first = {"David", "Mike", "Katie", "Lucy" };
String[] middle = {"A", "B", "C", "D", "E");
String[] last = {"Green", "Wong"};
String[] names - makeNames (first, middle, last);

In the example below the array names contains 20 names including "David A", "David B", "David C", ..., "Lucy E".

String[] first = { "David", "Mike", "Katie", "Lucy" };
String[] middle = {"A", "B", "C", "D", "E");
String[] last = {};
String[] names - makeNames (first, middle, last);

Use the method header:
public static String[] makeNames (String[] arrayı, String[ array2, String[] array3)

Do not use loops to implement the method. Instead, call the method you have written in the part (a) of this problem. Assume that the method you wrote in part (a) works as intended. Credit will not be given for this part of the problem if you reimplement any part of the code you wrote in part (a).

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 11:30
What does the https: // mean when you type in a website
Answers: 1
question
Computers and Technology, 24.06.2019 18:30
Is a type of bullying that takes place when a person intentionally posts negative information about another that is not true
Answers: 1
question
Computers and Technology, 25.06.2019 06:00
Me on this app how do you take a picture of your work
Answers: 1
question
Computers and Technology, 25.06.2019 08:10
Which of the following is an example of an input device? a barcode readeran organic light-emitting diodean inkjet printera cathode ray tube
Answers: 1
You know the right answer?
In this problem, you will write three methods to:
1) Create a string array containing permuta...
Questions
Questions on the website: 13722367