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
Naddika [18.5K]
3 years ago
10

Assume that a two-dimensional rectangular array of integers called matrix has been declared with six rows and eight columns. Wri

te a for loop to exchange the contents of the second column with the fifth column.
Mathematics
1 answer:
tatyana61 [14]3 years ago
5 0

Answer & Step-by-step explanation:

 //written in java

// program uses a for loop to exchange the contents of the second column with the fifth column in a six rows and eight columns array

public class Main{

   public static void main(String[] args) {

       //specifying an integer to hold values during swap

       int  value = 0;

       //sample array of

       int[][] arr = {

               {1, 2, 3, 4, 5, 6, 7, 8},

               {1, 2, 3, 4, 5, 6, 7, 8},

               {1, 2, 3, 4, 5, 6, 7, 8},

               {1, 2, 3, 4, 5, 6, 7, 8},

               {1, 2, 3, 4, 5, 6, 7, 8},

               {1, 2, 3, 4, 5, 6, 7, 8},

       };

       //loop to swap column 2 and column 5

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

           for (int j = 0; j < arr[i].length; j++) {

               if(j==1){

                   value = arr[i][j];

               }

               if(j==4){

                   arr[i][1] = arr[i][j];

                   arr[i][j] = value;

               }

           }

       }

       

       //loop to print out result

       for (int[] ints : arr) {

           for (int anInt : ints) System.out.print(" " + anInt);

           System.out.print("\n");

       }

   }

}

You might be interested in
Last year, the numbers of skateboards produced per day at a certain factory were normally distributed with a mean of 20,500 skat
Valentin [98]
Let x be a random variable representing the number of skateboards produced
a.) P(x ≤ 20,555) = P(z ≤ (20,555 - 20,500)/55) = P(z ≤ 1) = 0.84134 = 84.1%
5 0
4 years ago
Estimate the quotient 63.5 divided by 5
skad [1K]
Dividing by 5 is equivalent to dividing by 10 and then multiplying by 2.
therefore:

63.5/5 = (63.5/10) * 2 = 6.35 * 2 =12.70 which rounds to 13.
7 0
4 years ago
Which equation shows how the solution to 25x^2- 1=0 can be found by factoring?
stepladder [879]
D. Use FOIL and guess and check to factor the equation
5 0
4 years ago
Which number line represents the solution set for the inequality 3(8 – 4x) &lt; 6(x – 5)?
Marizza181 [45]

The number line which represents the solution set for inequality 3(8-4x)<6(x-5) is (3,inf).

Given an inequality 3(8-4x)<6(x-5).

We have to find the solution set for the given inequality.

<h3>What is inequality?</h3>

A statement of an order relationship greater than, greater than or equal to, less than, or less than or equal to between two numbers or algebraic expressions.

3(8-4x) < 6(x-5).

⇒ 24-12x<6x-30

⇒ 24+30<6x+12x

⇒ 54<18x

⇒ x>54/18

⇒ x>3

Hence, the number line which represents the solution set for inequality 3(8-4x)<6(x-5) is (3,inf).

That is starting from 3 and goes up to infinity.

To learn more about inequality visit:

brainly.com/question/24372553

#SPJ1

7 0
3 years ago
The Mount Rushmore Monument is 60 feet tall. A model of the monument is sold in the gift shop. If the model was made using a sca
Ann [662]

Answer:huh

Step-by-step explanation:huh

5 0
3 years ago
Other questions:
  • an orchard has 24 rows of apple trees there are 35 apple trees in each row how many apple trees are in the orchard
    13·2 answers
  • Draw and label a rectangle that has a smaller area than the area of a square that is 3 units on each side. What is the area of t
    11·1 answer
  • Last Sunday 1,575 people visited the amusement park 56% where adults, 16% where teens and 28% were children find out how many ad
    9·1 answer
  • Select the letter that correctly identifies the base of the prism.
    12·2 answers
  • If<br> 4x + y = 13<br> - y = 2<br> then y =
    8·2 answers
  • Use the permutation formula to solve a problem when n = 8 and r = 2.
    10·1 answer
  • 4n+2p-10=-2n+8p+2 someone pls solve this!
    12·1 answer
  • Help solve this I’m not sure if my answer was right. Pythagorean theorem.
    7·1 answer
  • What is the radius of the circle? cm<br>What is the circumference of the circle?​
    8·1 answer
  • A group of 180 students is divided into 20 teams for a competition. b. Part way through the competition, the students are gather
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!