i've been trying to figure out these questions and i can't seem to understand them...can anyone help?
1)Write a full program in C++ that creates the two-dimensional randomArray
array with 10 rows and 10 columns, and fills it with random numbers
respectively: the first row with random number in range [1, 100), the second
row with random number in range [100, 200), …, the 10th row with random
number in range [900, 1000), The program then displays the array elements
on-screen 10 in each row.
2) Create two arrays with 10 elements averageRows and averageColums.
Calculate the average value for each row of randomArray and assign them
respectively to elements of averageRows array. (The average of the first row
of randomArray to the first element of averageRows, … the average of the
last row of randomArray to the last element of averageRows). Fill in the
same way the averageColums array but this time with average values of
columns of randomArray. Calculate the average of the diagonal of array
averageRows (e00, e11, …, e99) and the average of elements of the second
diagonal of averageRows (e90, e81, …, e09). Display all the results on screen.
thx in advance ;)
1)Write a full program in C++ that creates the two-dimensional randomArray
array with 10 rows and 10 columns, and fills it with random numbers
respectively: the first row with random number in range [1, 100), the second
row with random number in range [100, 200), …, the 10th row with random
number in range [900, 1000), The program then displays the array elements
on-screen 10 in each row.
2) Create two arrays with 10 elements averageRows and averageColums.
Calculate the average value for each row of randomArray and assign them
respectively to elements of averageRows array. (The average of the first row
of randomArray to the first element of averageRows, … the average of the
last row of randomArray to the last element of averageRows). Fill in the
same way the averageColums array but this time with average values of
columns of randomArray. Calculate the average of the diagonal of array
averageRows (e00, e11, …, e99) and the average of elements of the second
diagonal of averageRows (e90, e81, …, e09). Display all the results on screen.
thx in advance ;)
Comment