Answer:
In Java programming language:
public static void displayArray7(int[][] arr) {
{
// Loop through all rows
for (int i = 0; i < arr.length; i++)
// Loop through all elements of current row
for (int j = 0; j < arr[i].length; j++)
System.out.print(arr[i][j] + " ");
}
}
Explanation:
Working with option a in the question int hours[5][7]; We created a main method, initialized the array hours[5][7]; and called displayArray7
public class ANot {
public static void main(String[] args) {
int hours[][] = {{1, 2, 3, 4, 5, 6, 6},
{3, 4, 5, 6, 6, 7, 7},
{4, 5, 6, 7, 8, 9, 0},
{56, 78, 54, 1, 21, 34, 4},
{5, 4, 6, 7, 7, 6, 7}};
// Calling the displayArra7 method
displayArray7(hours);
}
}