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
Ivenika [448]
3 years ago
9

Create a method called fixArray(int[][] array, int row, int col, int value) that sets the [row][column] to the correct value. Th

en, call the fixArray method three times - once for each value change that you are supposed to make.
Computers and Technology
1 answer:
PolarNik [594]3 years ago
7 0

Answer:

  1. public class Main {
  2.    public static void main (String [] args) {
  3.        int[][] myArray = {{1,5,6}, {7, 9, 2}};
  4.        fixArray(myArray, 1, 2, 12);
  5.        System.out.println(myArray[1][2]);
  6.    }
  7.    private static void fixArray(int[][] array, int row, int col, int value){
  8.        array[row][col] = value;
  9.    }
  10. }

Explanation:

The solution code is written in Java.

Firstly, create the method fixArray with that takes four inputs, array, row, col and value (Line 11). Within the method body, use row and col as index to address a particular element from array and set the input value to it (Line 12).

Next, we test the method in the main program using a sample array (Line 4) and we try to change the row-1 and col-2 element from 2 to 12 (Line 5).

The print statement in Line 7 will display 12 in console.

You might be interested in
What is the result of the following code?<br><br> x=7//2+10%2**4<br><br> print(x)
spin [16.1K]

Answer:

3

Explanation:

We can split the expression into two sections

First Section:

7 // 2 = 3. Using the floor division we only utilize the integer part.

Second Section:

10 % 2**4 = 0**4 = 0

Bringing back the full version expression we have

3 + 0 = 3

7 0
2 years ago
Kendra needs to configure a visual alert for an appointment that she is creating for next week. What should she configure?
sergiy2304 [10]
Reminder
To alert her
4 0
3 years ago
How can earn more answer from brainly less than two minutes, please
Andrei [34K]
You have to answer other people’s questions.
6 0
3 years ago
Consider the following program:
Nostrana [21]

Answer:

this would be answer D

Explanation:

7 0
3 years ago
Have you ever watched Full House? Who is your favorite character and why? EXPLAIN AND ILL GIVE BRAINLIEST!
liubo4ka [24]

Answer:

havent watched it and thanks for this

Explanation:

7 0
3 years ago
Other questions:
  • A ________ is a set of programs that manipulate the data within a database.
    12·1 answer
  • The rod and crankshaft convert the up-and-down motion of the piston into
    12·2 answers
  • Why does a satellite requires two bridges?
    11·1 answer
  • Ricardo twists his ankle at work but does not immediately realize that he is injured because his ankle is not sore or swollen, a
    5·1 answer
  • Which of these is not one of the main parts of an email
    9·1 answer
  • What tool is provided in Windows to facilitate sharing data objects between applications and computers?
    8·1 answer
  • What are youth oraganizations?
    7·1 answer
  • JPG is considered a lossy file format. What does this mean?
    15·2 answers
  • Who's hype for Halo Infinite?
    11·2 answers
  • What is the output for the following program?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!