(Two-Dimensional array Questions) Consider a 2-by-3 integer array t.
a) Write a declaration for t.
b) How many rows does t have?
c) How many columns does t have?
d) How many elements does t have?
e) Write the names of all the elements in row 1 of t.
f) Write the names of all the elements in column 2 of t.
g) Write a statement that sets the element of t in the first row and second column to
h) Write a series of statements that initialize each element of t to zero. Do not use a loop.
i) Write a nested counter-controlled for statement that initializes each element of t to zero.
j) Write a nested range-based for statement that initializes each element of t to zero.
k) Write a statement that inputs the values for the elements of t from the key board.
l) Write a series of statements that determine and display the smallest value in array t.
m) Write a statement that displays the elements in row 0 of t.
n) Write a statement that totals the elements in column 2 of t.
o) Write a series of statements that prints the array t in neat, tabular format. List the column subscripts as headings across the top and list the row subscripts at the left of each row.
Trending nowThis is a popular solution!
Chapter 7 Solutions
C++ How to Program (10th Edition)
- Problem Description - JAVA PROGRAMMING Use a Two-dimensional (3x3) array to solve the following problem: Write an application that inputs nine numbers, each of which is between 1 and 10, inclusive. Display the array after the user inputs each value. Rotate/flip the array by changing places. Make the rows columns and vice versa. You have to move the elements to their new locations. Remember to validate the input and display an error message if the user inputs invalid data. Documentation and the screenshot(s) of the results. Example: 1 2 3 4 5 6 7 8 9 the result will be : 1 4 7 2 5 8 3 6 9arrow_forwarda) create a method that accepts a 2D array and shuffles it values (like playing cards) b) test your method from main: print your 2D array before and after c) create a similar method that will return the array. Call and test it from main .arrow_forwardPart 4: Arrays Program c++ Write a program which takes 2 arrays of 10 integers each, a and b. c is another array with 20 integers. The program should put into e the appending of b to a, the first 10 integers of e from árray a, the latter 10 from b. Then the program should display the array c, then find and display the Minimum value of the array c. ANSWERarrow_forward
- Q2: Write a C# program that generates an array X(4×4) randomly (between 100, 999) and print: a) The average of prime number in X array b) The summation of each column c) The number of odd elements of each row Note: Don't use classes or functions to solvethe questionarrow_forwardCSEarrow_forwardGood evening, i am working on this arrays problem and was hoping you could help with it please? (my programming language is c++) Thanks!arrow_forward
- In c++arrow_forwardii) What will be the maximum element of the array given below if the first k elements are removed from the array. Input the value of k from the user. int A[] = {34, 67, 1, 89, 156, -12, 78, 100, 23}; Programming languages: C/C++arrow_forwardConsider a two-by-three integer array t. h) Write a series of statements that initializes each element of t to zero. Do not use a repetition statement. i) Write a nested for statement that initializes each element of t to zero. j) Write a nested for statement that inputs the values for the elements of t from the user. k) Write a series of statements that determines and displays the smallest value in t. l) Write a printf statement that displays the elements of the first row of t. Do not use repetition. m) Write a statement that totals the elements of the third column of t. Do not use repetition. n) Write a series of statements that displays the contents of t in tabular format. List the column indices as headings across the top, and list the row indices at the left of each row.arrow_forward
- 1.) How to outpit an element of an array? 2.) How to put element to an array? 3.) How to use array with a looping structur?arrow_forward2. Intersection Write a method/function that takes two circular arrays, their sizes and start indexes and returns a linear array containing the common elements between the two circular arrays. DO NOT convert the circular arrays to linear arrays to solve the problem. Input: Circular array 1: [40,50,0,0,0,10,20,30] (start_1 =5, size_1 =5) Circular array 2 : [10,20,5,0,0,0,0,0,5,40,15,25] (start_2=8, size_2 =7) Output: [10,20,40] Use Python Languagearrow_forwardWords: QUESTION 2 Write java program to create an array that read 5 double numbers. The program should display the array and the total number of all elements in the array.arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr