Practice (evaluated)
Multi-dimensional arrays. Homework
39.51K

2Darrays_practice

1. Practice (evaluated)

• Sum of Elements: Initialize a 2D integer array with User input (user needs
to give size of the array (rows, columns) and the numbers/values) and write
a program to calculate and print the sum of all elements using nested
loops.
• Find max element and its position: Initialize a 2D integer array with User
input (user needs to give size of the array and the numbers) and write a
program that returns max element and it position: [maxValue, rowIndex,
colIndex].
• Check if matrix is symmetric (only for a square matrix)
A matrix is symmetric if matrix[i][j] == matrix[j][i].

2. Multi-dimensional arrays. Homework

• Sum of Odd Elements: Initialize a 2D integer array with User input
(user needs to give size of the array and the numbers) and write a
program to calculate and print the sum of all even and sum of all odd
elements using nested loops.
• Find Max and Min in a Row: Create a 2D integer array with User input
(user needs to give size of the array and the numbers) and write a
method that takes the array and a row index as input, then finds the
maximum and minimum values within that specific row.
English     Русский Правила