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
Write a C function which mimics the behavior of the assembly language function below. Note that this time, the assembly language
Digiron [165]

Answer:

#include <stdio.h>

int f(int edi) {

 

  if (edi == 1) {

      return 1;  

  }

  if (edi <= 0) {

      return 0;

  }

 

  edi--;

  int eax = f(edi);

 

  if(eax == 0) {

      return 1;

  } else {

      return 0;

  }

}

int main(void) {

  int edi = 9;

  int ret;

  ret = f(edi);

  printf("%d", ret);

  return 0;

}

Explanation:

  • Inside the function f, check if edi is 1 or less than 1 and then return a number accordingly.
  • Decrement the edi variable, call the f function and assign its value to eax.
  • Check if eax is equal to 0 then return 1 else return 0.
  • Inside the main function, call the f function by passing the edi value and finally display the value of ret.
6 0
3 years ago
How many much memory is in one megabyte ?
Igoryamba

Answer: 8 bits is a byte. 1000 bytes are a kilobyte. 1000 kilobytes are a megabyte.

5 0
2 years ago
What exactly does the value recorded in a single dimension of a sift keypoint descriptor signify?
mash [69]
SIFT image features provide a set of features of an object that are not affected by many of the complications experienced in other methods, such as object scaling and rotation.
5 0
3 years ago
Which tool allows multiple users to dynamically update a document at the same time? Question 3 options: Google Docs OneDrive Exc
GenaCL600 [577]

Answer:

Excel

Explanation:

7 0
2 years ago
Uses of the following button in a keyboard: Prt SC, Home, Shift, Tab, Pg Up.​
creativ13 [48]

Answer:

This Print Screen key is used to take the screenshots of all that is appearing on the screen, and this can then be pasted in paint and saved in some location of the computer.

The Home key takes the cursor from the current position to the top left, or the start of the file.

Shift: There are two shift keys. And they are used to print the character in the capital. And when the caps lock is busy it can be used to print in lower case. It is also used together with arrow keys to select a part of the text.

Tab: This key moves the cursor from the current location to the location which we know as tab stops ( and the very next one).

Pg Up:​ The page up is being used for scrolling up, and the distance to which limit the scrolling will take place depends upon the application you are working on.

Explanation:

Please check the answer.

4 0
3 years ago
Other questions:
  • A ____ operating system should be capable of supporting the applications and tools necessary to support Internet operations.
    10·1 answer
  • How do I write code in Java for "A spinner for a game has four possible options: blue, red, yellow, green. The chance of landing
    10·1 answer
  • Blank are back and forth movement of matter that create sound​
    15·1 answer
  • Explain briefly why every person in the world is not connected to the Internet.
    9·1 answer
  • Write a program to randomly fill an array of float of 10 elements (use the rand() function and make sure to use #include ) in ma
    11·1 answer
  • How do you change your age on Brainly?
    10·1 answer
  • The illustration shows different types of text language.
    5·2 answers
  • g Which of the following factors primarily determines how the Internet is used in different countries? A. local attitude to info
    6·1 answer
  • Write a method doubleUp that doubles the size of a list of integers by doubling-up each element in the list. Assume there's enou
    13·1 answer
  • The computer scientists Richard Conway and David Gries once wrote: The absence of error messages during translation of a compute
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!