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, 22.06.2019 00:00
Which requirement is an appropriate reason for a business to use it tools
Answers: 3
question
Computers and Technology, 22.06.2019 10:10
3. bob is arguing that if you use output feedback (ofb) mode twice in a row to encrypt a long message, m, using the same key each time, it will be more secure. explain why bob is wrong, no matter what encryption algorithm he is using for block encryption (15 points).
Answers: 3
question
Computers and Technology, 22.06.2019 19:20
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_cost should be removed since header files should not contain constants.c)the definition of book should be removed since header files should not contain class definitions.d)the body of the calculate_terms function should be added to the header file.
Answers: 1
question
Computers and Technology, 22.06.2019 21:30
The salespeople at hyperactive media sales all use laptop computers so they can take data with them on the road. you are a salesperson for superduper lightspeed computers talking to hyperactive media sales about upgrading the laptops to windows 10. explain how network location awareness in windows 10 would make the laptops more secure.
Answers: 3
You know the right answer?
In this problem, you will write three methods to:
1) Create a string array containing permuta...
Questions
question
Social Studies, 02.04.2021 01:00
question
Mathematics, 02.04.2021 01:00
question
Social Studies, 02.04.2021 01:00
Questions on the website: 13722363