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, 21.06.2019 21:30
Felicia wants to become a head surgeon by december 2013. she designs the career milestones that she would need to complete her goal. by june 2013, she was not licensed. which best describes what she should do?
Answers: 2
question
Computers and Technology, 23.06.2019 08:00
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
To check whether your writing is clear , you can
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 1
You know the right answer?
In this problem, you will write three methods to:
1) Create a string array containing permuta...
Questions
question
Mathematics, 07.09.2021 18:10
question
English, 07.09.2021 18:10
question
Mathematics, 07.09.2021 18:10
question
Mathematics, 07.09.2021 18:10
question
Mathematics, 07.09.2021 18:10
question
Mathematics, 07.09.2021 18:10