Which of the following declares a four-element one-dimensional array?a. Dim strLetters() As String = "A", "B", "C", "D"b. Dim strLetters(3) As String = {"A", "B", "C", "D"}c. Dim strLetters(3) As Stringd. both b and c
Q: Which of the following is a correct insert method for inserting an element into an array? public…
A: Logic to insert element is we need to shift all the elements by one postion right from to…
Q: Which correctly creates an array of five empty Strings? O String] a = new String [5]; O String[] a =…
A: The answer of this question is as follows:
Q: Prompt the user for data points. Data points must be in this format: string, int. Store the…
A: Java ArrayList data structure : The java. util package contains the ArrayList class. The ArrayList…
Q: a program đô the follOwing: Ask the user to input his/her first name and store it in a String…
A: GIVEN: Create a java program that gets the first name from the user and stores it in the Array list.…
Q: A. Edit the following code so that it return true only if the key is found in the 2D array at least…
A: public static boolean search(String[][] array2D,String key) { //this variable is used as…
Q: In the main() method, create two arrays: String[] wordsFromFile1;…
A: Step 1: Declare class Main. Define calculateTokenCounts() method that determines the count of tokens…
Q: Assume you have created a two-dimensional array, called names, where all rows have the same number…
A: Below is the answer with explanation:
Q: Which of the following method is used to get the position of a particular element in an ArrayList?…
A: contain() --> This method check whether a string contains a sequence of character or not.…
Q: Write a program that has an array of at least 10 string objects that hold people’s names and phone…
A: #include<iostream>#include<string>#include<cctype>using namespace std; #define…
Q: There are different data types for variables, and the following are all valid ones, except: Group of…
A:
Q: Create 4 arrays of type integer having size of 11 and assign values to only 2 arrays using for loop.…
A: Note : Here I have taken the same values as given in the picture as input from user. Algorithm :…
Q: Which of the following prints the number of elements of the array list? Select one: a.…
A: b. System.out.println(myArrayList.size());
Q: What is the length of the array: int[] intArray = { 1, 2, 3, 5, 6, 7 }; Select one: O a. None of the…
A: length of the array is b. 6
Q: With the statement, int grades] = [70,80,90,100,50); What is the name of the array? O…
A: Given:
Q: ce Hstory Bill Details (String text, String textl, String text2) { n = text: ni - textl; = text2;…
A: To do: FIx the problem
Q: In the main() method, create two arrays: String[] wordsFromFile1;…
A: SUMMARY: -Taking input from the file we displaced the total no of token.
Q: In the composer array, create a statement that copies the string "Beethoven."
A: STATEMENT: This statement copies the string Beethoven into the composer array. stripy is the…
Q: What is the subscript for the first element?
A: Array An array is one of the most popular "linear data structure" that allows us to store several…
Q: Write a statement that creates an array of 3 string values referenced by a variable named fullName.…
A: String array: An array is an object which holds the group of values of same type. An array of…
Q: Which of the following correctly declares an array? a. int arr; b. int arr[array size]: O c.…
A: Here have to determine correct option for programming code to declare array.
Q: 4. Create a main method that will create a 2-d array with 4 rows and 5 columns. Call the method from…
A: First, we will be creating a 2-D array with 4 rows and 5 coloumns with the help of nested lists.…
Q: Which of the following is false?a. The last element of an array has position number one less than…
A: An array is a collection of elements of same date type that are stored in continuous memory…
Q: Select the correct and safe ways to read a string with spaces from the user at the runtime and store…
A: Given data is shown below:
Q: Which accesses the number of elements in groceryList? ArrayList groceryList; groceryList = new…
A: Solution:
Q: Given these three ArrayLists: ArrayList collectionA = new ArrayList(); ArrayList collectionB = new…
A: Integer is the theoretical limit for ArrayList capacity. MAX VALUE of integer, also known as…
Q: Question 2 Let say an Array consist of String names as follow: [i] [0] [1] [2] [3] [4] [5] [6]…
A: #include <stdio.h> #include <string.h> int main() { char str[100]; //string for…
Q: write a (GUI) application that asks a user how many integers to be entered, then stores the integers…
A: Given data is shown below: write a (GUI) application that asks a user how many integers to be…
Q: Which statement/s will declare an array of integers that has 8 elements? int[] n = new int[8]; int…
A: EXPLANATION: The general declaration of the variable of array type requires the following items:…
Q: Which of the following array initialization statement is valid? int ary{4}=[1,2,3,4]: int…
A: The Answer is in Below Steps
Q: Which of the following are correct ways of declaring a 2D array. Select all that apply. int data[]…
A: your answer is given below:
Q: Which of the following method is used to get the position of a particular element in an ArrayList?…
A: The correct answer is Option A.
Q: Which of the following is the correct declaration of an array? string fruit{3} = {"Apple", "Banana",…
A: We have to find which of the following given options is the correct declaration of array.
Q: Which of the following declares an array list of double named GPA O a. ArrayList GPA O b. double…
A:
Q: Write a program that prompts the user to input a string and outputs the string in uppercase letters…
A: C++ code
Q: Which of the following statement will display elements of the array in one line at a time? char…
A: Required: Which of the following statement will display elements of the array in one line at a…
Q: The Chat-A-While phone company provides service to six area codes and charges the per-minute rates…
A: Below is the required code in C# language. Program Approach: Make use of namespace to get a…
Q: Given the below 2 arrays: int arr1[] = { 9,8,7,6,5,4,3,2,1,0 }; int arr2[] = {…
A: import java.lang.*;import java.util.*;public class Main{ public static void main(String[] args) {…
Q: The code to traverse a two-dimensional array using the For Each...Next statement requires two loops.…
A: To traverse a two-dimensional array using For Each….Next statement it requires outer loop to iterate…
Q: Which of the following declares an empty array?a. Private strStates() As String = ()b. Private…
A: An array, which has no elements, is called an empty array. An empty array is declared using an empty…
Q: Write a program that do the following: Ask the user to input his/her first name and store it in a…
A: PROGRAM STRUCTURE: Import the required packages. Start the definition of the main public class.…
Q: Determine if the following statement are true or false screen shot shows the text's…
A: According to our rules, we should answer only the first question when many questions are posted.…
Q: int[]myArray=newint[7]; c. int[][]myArray=newint[3][4];
A: Explanation: A 2D array's items are designed in rows and columns, and the new operator for 2D arrays…
Q: Which statement shows an array declaration with 4 columns and 3 rows? O int [3][4]values; O int…
A: Declaring Arrays: To declare an array in C, a programmer specifies the type of the elements and the…
Q: Using the two arrays shown below,write a program that prompts the user to enter an integer between 1…
A: PROGRAM STRUCTURE: Import the Scanner class to use the Scanner function to take the input from…
Q: Write a program that can be used to assign seats for a commercial airplane. The airplane has 13…
A: Using C++ Language
Q: In your code, create an enum with 5 options. Then create an array with 5 strings. Each string is a…
A: Introduction In your code, create an enum with 5 options.Then create an array with 5 strings.Each…
Q: Which of the following is a correct declaration of a variable and a call to a constructor of an…
A: As per our guidelines we are supposed to answer only one question. Kindly repost the remaining…
Which of the following declares a four-element one-dimensional array?
a. Dim strLetters() As String =
"A", "B", "C", "D"
b. Dim strLetters(3) As String =
{"A", "B", "C", "D"}
c. Dim strLetters(3) As String
d. both b and c
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- What is the index of the letter F in this array? char textMessage[] = "Have Fun with Arduino"; MULTIPLE CHOICE QUESTION; A.6 B.5 C.4 D &textMessage+5A personal phone directory contains room for first names and phone numbers for 30 people. Assign names and phone numbers for the first 10 people. Prompt the user for a name, and if the name is found in the list, display the corresponding phone number. If the name is not found in the list, prompt the user for a phone number, and add the new name and phone number to the list. Continue to prompt the user for names until the user enters quit. After the arrays are full (containing 30 names), do not allow the user to add new entries. Use the following names and phone numbers: Name Phone # Gina (847) 341-0912 Marcia (847) 341-2392 Rita (847) 354-0654 Jennifer (414) 234-0912 Fred (414) 435-6567 Neil (608) 123-0904 Judy (608) 435-0434 Arlene (608) 123-0312 LaWanda (920) 787-9813 Deepak (930) 412-0991A personal phone directory contains room for first names and phone numbers for 30 people. Assign names and phone numbers for the first 10 people. Prompt the user for a name, and if the name is found in the list, display the corresponding phone number. If the name is not found in the list, prompt the user for a phone number, and add the new name and phone number to the list. Continue to prompt the user for names until the user enters quit. After the arrays are full (containing 30 names), do not allow the user to add new entries. Using Scanner.input to prompt user, Use the following names and phone numbers: Gina (847) 341-0912 Marcia (847) 341-2392 Rita (847) 354-0654 Jennifer (414) 234-0912 Fred (414) 435-6567 Neil (608) 123-0904 Judy (608) 435-0434 Arlene (608) 123-0312 LaWanda (920) 787-9813 Deepak (930) 412-0991
- A personal phone directory contains room for first names and phone numbers for 30 people. Assign names and phone numbers for the first 10 people. Prompt the user for a name, and if the name is found in the list, display the corresponding phone number. If the name is not found in the list, prompt the user for a phone number, and add the new name and phone number to the list. Continue to prompt the user for names until the user enters quit. After the arrays are full (containing 30 names), do not allow the user to add new entries. Use the following names and phone numbers:A personal phone directory contains room for first names and phone numbers for 30 people. Assign names and phone numbers for the first 10 people. Prompt the user for a name, and if the name is found in the list, display the corresponding phone number. If the name is not found in the list, prompt the user for a phone number, and add the new name and phone number to the list. Continue to prompt the user for names until the user enters quit. After the arrays are full (containing 30 names), do not allow the user to add new entries. Use the following names and phone numbers: Name Phone # Gina (847) 341-0912 Marcia (847) 341-2392 Rita (847) 354-0654 Jennifer (414) 234-0912 Fred (414) 435-6567 Neil (608) 123-0904 Judy (608) 435-0434 Arlene (608) 123-0312 LaWanda (920) 787-9813 Deepak (930) 412-0991 import java.util.*; class PhoneNumbers { public static void main(String[] args) { // Write your code here } }A personal phone directory contains room for first names and phone numbers for 30 people. Assign names and phone numbers for the first 10 people. Prompt the user for a name, and if the name is found in the list, display the corresponding phone number. If the name is not found in the list, prompt the user for a phone number, and add the new name and phone number to the list. Continue to prompt the user for names until the user enters quit. After the arrays are full (containing 30 names), do not allow the user to add new entries.
- Which of the following prints the number of elements of the array list? Select one: a. System.out.println(myArrayList.elements()); b. System.out.println(myArrayList.size()); c. System.out.println(myArrayList.size); d. System.out.println(myArrayList.elements);JAVA Write an application containing three parallel arrays that hold 10 elements each. The first array hold four-digit student ID numbers, the second array holds first names, and the third array holds the students’ grade point averages. Use dialog boxes to accept a student ID number and display the student’s first name and grade point average. If a match is not found, display an error message that includes the invalid ID number and allow the user to search for a new ID number.24) Which XXX is most appropriate for printing out the char array userText?char userText[10] = "zyBook";for (i = 0; XXX; ++i) {// Print userText[i]}a. i < 6b. i <= 6c. userText != '\0'd. userText[i] != '\0'
- Write a program that deletes the first element in an array which matches a search key. Advance thanks <3Using the two arrays shown below,write a program that prompts the user to enter an integer between 1 and 12 andthen displays the months and its number of days corresponding to the integerentered. Your program should display “wrong number” if the user enters awrong number by catching ArrayIndexOutOfBoundsException. String[] months = {"January", "February", "March", "April","May", "June","July", "August", "September", "October","November", "December"};int[] dom = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};In the main() method, create two arrays: String[] wordsFromFile1; String[] wordsFromFile2; Read "GettysburgAddress.txt" file and "SecondInauguralAddress.txt" file. Store their words into these two arrays. Create a method: public static void calculateTokenCounts(String[] raw, String[] tokens, int[] counts) where raw is the raw String[] array we got from getFileWords() method. String[] tokens and int[] counts are defined before calling the method. After method execution, the tokens and their counts in the raw array should be added to the the tokens and counts array. Note that the tokens and counts array may already have data in them. You can not do a fresh overwrite. Then create two arrays: String[] totalTokens int[] totalCounts use calculateTokenCounts () method to populate the latter two arrays with data from the two wordsFromFileX array. plz answer this question using java in eclipse