Ask Question
5 July, 19:14

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.

+2
Answers (1)
  1. 5 July, 20:52
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers