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
(will give brainliest if correct) What is the parent function of the following transformed absolute value function:
Lunna [17]

Step-by-step explanation:

<u>ybfekchhxgudddy</u><u> </u><u>kk</u><u> </u><u>fija</u>

4 0
3 years ago
much they will have left over. (a) If a package of curtains cost $21.50, what is the cost of the 3 packages of curtains in the c
wariber [46]

64.5 is the answer.

I HOPE THIS HELPS HAVE A GREAT DAY!

8 0
3 years ago
Read 2 more answers
sonia needs to use 1/4 cup of water for her recipe, but she only has 1/8 cup measure. Which equivalent fra tions shows the amou
MaRussiya [10]
1/4 is equal to 2/8 and 1/8 is equal to 2/16
8 0
3 years ago
Please help me for 20 points
liberstina [14]
2b² - 3b + 4a²
= 2(8)² - 3(8) + 4(-6)²
= 2(64) - 24 + 4(36)
= 128 - 24 + 144
= 248
5 0
3 years ago
One B has a diameter of 12 kilometers and a slant height of 10 kilometers. Determine the volume of Cone B.
Olenka [21]

Answer:

The answer no matter how you slice it is 301.59km^3. I tried many methods but to no avail haven't seen any of the given answers provided. For the slant and radius make up a right triangle to get the height 8km to be used in the formula to get the answer I previously stated.


4 0
3 years ago
Other questions:
  • A population has a mean mu μ equals = 87 and a standard deviation σ = 24. Find the mean and standard deviation of a sampling dis
    7·1 answer
  • Solve for f. h = f² + 2g
    10·2 answers
  • 20 POINTS !! HELP FAST Cindy and Giovanni plan to make spaghetti sauce. Cindy needs 4 3/4 pounds of tomatoes for her recipe. Gio
    14·2 answers
  • What percent is 457 is 41.13?
    7·1 answer
  • How would you write 1 - x^4 before you divide it by x - 1?
    10·1 answer
  • PLZ HELP, I KEEP GETTING PEOPLE THAT JUST WANT POINTS!!
    15·2 answers
  • Last year Nancy weighted 37( 5)/(8) pounds. This year she weighed 42.7 pounds. How much did she gain?
    7·1 answer
  • How do you simplify -1/2 (-5/6 + 1/3)?​
    9·1 answer
  • Determine - f(a) for f(x) = 2x/x-1 and simplify
    8·1 answer
  • Please answer !!!!!!!!!!
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!