Answer 1:
numberArray[0][0]=145;
Answer 2:
numberArray[8][10]=18;
Answer 3:
for(int i=0;i<values.length;i++)
for(int j=0;j<values[i].length;j++)
sum+=values[i][j];
Answer 4:
size of array must be constant, we can not use variable for creating array
Answer 5:
No error in the code
Answer 6:
Before Sort
28,10,50,34,67,
10,28,34,50,67,
10,28,34,50,67,
10,28,34,50,67,
10,28,34,50,67,
After Sort:
10,28,34,50,67,
Refer to the following array definition for questions 1 & 2 int numberArray[9)[11] 1. Write a...
c++ 48. values is a two-dimensional array of floats with 10 rows and 20 columns. Write code that sums all the elements in the array and stores the sum in the variable total 48. values is a two-dimensional array of floats with 10 rows and 20 columns. Write code that sums all the elements in the array and stores the sum in the variable total
Part 2) write a C++ program that declares a 2 dimensional array: int CSIIAssign3 [10][12]; Initialize your array using a text file, user input or assign value while declaring the array, you can choose the method. Then, a. Write a loop to print first row of the array on one line, using cout. b. Write a loop to print first column of the array on one line, using cout. c. Write a loop to print first five rows of the...
c++ Consider the following array definition: int values[5] = {4,7,6,8,2}; What does each of the following statements display? cout << values[4] << endl; cout< < (values[2] + values[3])<<endl; cout << ++values[1] << endl; marks is an integer array with 20 elements. Write a for loop that prints each element of the array. The arrays numberArray 1 and numberArray2 have 100 elements. Write code that copies the values in numberArrayl to numberArray2.
Write a java code that Declares and initialize a two-dimensional int array named grades. It should have 10 rows and 6 columns where it stores the values and then calculates the average of all the elements in the grades array that you have declared
Program in C++! Thank you in advance! Write a menu based program implementing the following functions: (1) Write a function that prompts the user for the name of a file to output as a text file that will hold a two dimensional array of the long double data type. Have the user specify the number of rows and the number of columns for the two dimensional array. Have the user enter the values for each row and column element in...
Consider the following statements: int numbers[][] = {{1}, {1, 2}, {1, 2, 3}}; What is the size of the array? 3 rows, 3 columns 3 rows, 1 column 1 row, 3 columns 3 rows, 2 columns When you declare an array using the following statement inside a function, the element values are automatically initialized to 0. int matrix[5][5]; How many elements are array matrix[5][5][2]?
Write a java program: Create a method fillRandom() that accepts an array of int as input and populates it with random numbers in the range -999 to 1000 Explicitly store zero in index [0] and 900 in index [1]. (0 and 900 will be used as search keys) Create a method DisplayLastInts() that accepts an array of int as input and displays the last hundred elements to the screen in rows of 10 elements. Format the output so the 10...
Suppose v is an array with 100 int elements. If 100 is assigned to v[100], what happens? Show the code. An array of 1000 integers is declared. What is the largest integer that can be used as an index to the array? Shows the code. Consider the declaration: int v[1]; What is the index of the last element of this array? Declare an array named a of 10 int elements and initialize the elements (starting with the first) to the...
Write a menu based program implementing the following functions: (0) Write a function called displayMenu that does not take any parameters, but returns an integer representing your user's menu choice. Your program's main function should only comprise of the following: a do/while loop with the displayMenu function call inside the loop body switch/case, or if/else if/ ... for handling the calls of the functions based on the menu choice selected in displayMenu. the do/while loop should always continue as long...
Define a two-dimensional int array which has 5 rows and 3 columns. The elements in array is randomly initialized (using Math.random()). Write a method to find the maximum value in this two dimensional array; Write a method to find the average value in the array; Write a method to count how many elements are smaller than average; Write a method to copy contents in a two-dimensional array to a one-dimensional array. The method will return this one-dimensional array. Method is...