![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 29.01.2021 17:20 noobgirlaskthequest
Write a public static method named insert. The insert method should have the signature insert(String[] words, String newWord, int place), should return a boolean, and should function as described below.
When called, if place does not represent a valid index for words, then the method will return false to indicate the insertion could not be performed and do nothing else. Otherwise the method will insert the String newWord into the array words at the index place, moving each subsequent entry one place further and losing the final String in the array. The method will then return true to indicate the insertion has taken place.
Use the runner class to test this method: do not add a main method to your code in the U6_L4_Activity_One. java file or it will not be scored correctly.
Here is the runner code:
import java. util. Scanner;
public class runner_U6_L4_Activity_One{
public static void main(String[] args){
Scanner scan = new Scanner(System. in);
System. out. println("Enter array length:");
int len = scan. nextInt();
scan. nextLine();
String[] wordList = new String[len];
System. out. println("Enter values:");
for(int i = 0; i < len; i++){
wordList[i] = scan. nextLine();
}
System. out. println("Enter new String:");
String insWord = scan. nextLine();
System. out. println("Enter place:");
int pos = scan. nextInt();
System. out. println("Method return: " + U6_L4_Activity_One. insert(wordList, insWord, pos));
System. out. print("Array contents: {");
for(int i = 0; i < len-1; i++){
System. out. print(wordList[i] + ", ");
}
System. out. println(wordList[len-1]+"}");
}
}
![ansver](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 05:00
Pls do you believe that the use of 3d animation has grown in feature films over the last few years? if so, do you think the trend will continue? what are the forces driving this trend?
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 11:00
What is the foundation for proper monitoring, load balancing and routing in distributed systems
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 13:00
In excel - calculate the actual increase/decrease from first quarter to the second quarter then subtract subtract first quarter value from second quarter total then divide result by first quarter value
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 16:00
Your is an example of personal information that you should keep private.
Answers: 2
You know the right answer?
Write a public static method named insert. The insert method should have the signature insert(String...
Questions
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/himiya.png)
Chemistry, 08.04.2021 20:50
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 08.04.2021 20:50
![question](/tpl/images/cats/en.png)
English, 08.04.2021 20:50
![question](/tpl/images/cats/mat.png)
Mathematics, 08.04.2021 20:50
![question](/tpl/images/cats/fr.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mkx.png)
Arts, 08.04.2021 20:50
![question](/tpl/images/cats/mat.png)
Mathematics, 08.04.2021 20:50
![question](/tpl/images/cats/mat.png)
Mathematics, 08.04.2021 20:50
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 08.04.2021 20:50
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/fizika.png)
Physics, 08.04.2021 20:50
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/biologiya.png)
Biology, 08.04.2021 20:50
![question](/tpl/images/cats/mat.png)
Mathematics, 08.04.2021 20:50