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
Simplify .90(13-L) plus 1.25L equals 14.85​
irina1246 [14]

Answer:

L=9

Step-by-step explanation:

5 0
3 years ago
The function f(x) varies inversely with x and f(x)=2 when x = 16.<br><br> What is f(x) when x = 4?
andrew-mc [135]

Answer: The correct answer is:  [D]:  "8" .

Step-by-step explanation:f y varies inversely with x;  then y = k/x ; with "k" being the "constant" in this equation.  

You can find the constant by substituting the values given: x = 16,  f(x) = y = 2 ;

So, f(x) = y = 2  = k/16 ;

→  2 = k / 16 ;

Solve for the constant; "k" ;

Multiply EACH SIDE of the equation by "16"

→  16* (2) = (k / 16) * 16 ;

→  32 = k ;

 ↔  k = 32 ;  

As such, we can write the equation:

y = k/ x ; as:

→  y = 32/ x ;

Since we are given:  "x = 4" ;  Plug in that value; and solve for "y" ;

y = 32/4 = 8 .

y = 8 .

y = f(x) ;

So;  f(x) = 8 ;  which is:  Answer choice:  [D]:  "8" .

8 0
3 years ago
Solve for all values of x by factoring. x^2-x=3x
ki77a [65]
Do you have a picture ?
6 0
3 years ago
Alicia is solving the equation 2.3 x minus 1.6 = 8.8 minus 2.9 x. Which equations represent possible ways to begin solving for x
sleet_krkn [62]

Answer:

2.3 x = 10.4 - 2.9 x

2.3 x - 10.4 = 2.9 x

5.2 x -1.6 = 8.8

Step-by-step explanation:

3 0
4 years ago
Read 2 more answers
I help me please I need these answers
Ivan

Answer:

G i think that is the answer

Step-by-step explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • In one paragraph, summarize the life and story of Cleoparta
    10·2 answers
  • 360 Kilometers is 24% of _____ Kilometers
    6·2 answers
  • Clare went to a concession stand that sells pretzels for $3.25 drinks for $1.85, and bags popcorn for $0.99 each she bought at l
    14·1 answer
  • 77÷1232=? ...........​
    5·1 answer
  • What is the expression in factored form . 9x^2 -4
    11·2 answers
  • What does 4y + y equal
    10·2 answers
  • Find the value of each variable. write your answers in simplest radical form
    15·1 answer
  • Maddy's fourth grade class is going on 5 field trips. Each has a fee of $12.10. Sack lunches for each trip are an additional $2.
    13·2 answers
  • A 4-column table with 5 rows. The first column is labeled age (years) with entries 1, 2, 3, 4, 5. The second column is labeled g
    6·2 answers
  • School play: There are 48 students in a school play. The ratio between boys and girls is 5: 7. How many more girls than boys are
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!