Ask Question
10 March, 13:54

Assume you are given a boolean variable named isSquare and a 2-dimensional array that has has been created and assigned to a2d. Write some statements that assign true to isSquare if the entire 2-dimensional array is square meaning every row and column has the same number of elements as every other row and column.

+3
Answers (1)
  1. 10 March, 14:14
    0
    isSquare = true;

    for (int i = 0; i < a2d. length && isSquare; i++)

    if (a2d[i]. length! = a2d. length)

    isSquare = false;
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Assume you are given a boolean variable named isSquare and a 2-dimensional array that has has been created and assigned to a2d. Write some ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers