1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aivan3 [116]
4 years ago
8

Assume you are given a boolean variable named isRectangular and a 2-dimensional array that has has been created and assigned to

a2d. Write some statements that assign true to isRectangular if the entire 2-dimensional array is rectangular, meaning every row has the same number of elements as every other row.
Mathematics
1 answer:
Savatey [412]4 years ago
4 0

Answer:

nElements = 0;

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

nElements += a2d[i].length;

isRectangular = true;

for (int i = 1; i < a2d.length && isRectangular; i++)

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

isRectangular = false;

Step-by-step explanation:

2 dimensional array is created and  initialize element with 0. and the taking loop for 2 dimensional array .such as

n Elements = 0;

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

n Elements += a2d[i].length;

A boolean variable isRectangular and 2 dimensional array has been created if rectangle is true the take a2d.length and isRectangular less than i and intiliaze i with 1 then increment the i .It will give true value.

If rectangular is false then  apply if statement  and see if a2d[i] is not equal to a2d[0]

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

isRectangular = false;

You might be interested in
Please help with number 3!!! ASAP!!!!
Otrada [13]
LCM I believe. Because it’s every 6 days he does both
3 0
3 years ago
Read 2 more answers
Will mark brainliest ​
adelina 88 [10]

Answer:

no, it'll become -10. 9 will be greater

Step-by-step explanation:

3 0
3 years ago
Mike bought a soft drink for 4 dollars and 9 candy bars. He spent a total of 31 dollars. How much did each candy bar cost ?
Andre45 [30]

Answer:

$3 per candy bar

Step-by-step explanation:

:))

7 0
3 years ago
How many hours of training would you need to have a monthly pay of $1500. (Hours of Training 10. Monthly pay 1220.)
White raven [17]

Answer:you will need about 12.29508197 hours of training

Step-by-step explanation:

7 0
4 years ago
Which ordered pair is a solution of the equation
Sever21 [200]

Answer:

a

Step-by-step explanation:

2x+3y where it is 2,2 become 4 plus 6 which is 10

3 0
3 years ago
Read 2 more answers
Other questions:
  • A cylinder has a Height 12 and a radius 3.7 what is it’s volume?
    9·1 answer
  • <img src="https://tex.z-dn.net/?f=10%20%7Bx%7D%5E%7B2%7D%20-%206%20%3D%20144%20" id="TexFormula1" title="10 {x}^{2} - 6 = 144 "
    8·1 answer
  • Find the height of cylinder when volume is 154 cm^3 volume and radius is 3 cm
    7·1 answer
  • Find the relative minimum of this equation<br>​
    10·1 answer
  • How many years will it take for an initial investment of $20000 to grow to $50000? Assume a rate of interest of 17% compounded c
    8·1 answer
  • Explain how you know that the sum of 12.6, 3.1, and 5.4 is greater than 20
    9·1 answer
  • Please help will give BRAINLIEST
    12·1 answer
  • Find the area of a circle with radius, r = 7.29m. Give your answer rounded to 2 DP
    9·1 answer
  • Paper cups are sold in packages of 6 and napkins are sold in packages of 8 I want to buy the same number of each what is the lea
    5·1 answer
  • Write the expression of polynomial a given the roots:
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!