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
Rashid [163]
4 years ago
5

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:
Kobotan [32]4 years ago
8 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
Yeah help me please......................
OlgaM077 [116]
Sorry if I’m wrong, but I believe it would be the title so A dry white season
5 0
3 years ago
Is it possible to connect a piano using a micro usb instead of a midi cord?
ValentinkaMS [17]

Answer:

MIDI might be a better option.

Explanation:

USB is much faster, and just as reliable as a MIDI cable. An external disk drive with a USB connection transmits data thousands of times faster than a single MIDI instrument with no problems! If you want to use very long cables, for on-stage work for example, MIDI might be a better option.

8 0
3 years ago
A database program helps to ____________.
Juliette [100K]
D. A database is software which is designed to store massive amounts of data and organize them in such a way that information can easily be worked on (added, deleted, moved, etc...).
8 0
3 years ago
Read 2 more answers
What is the value of the variable result after these lines of code are executed?
zhuklara [117]

Answer:

result = 6

Explanation:

Just substitute the numbers for the variables:

(3*2) - (0*2) = 6

so result = 6

4 0
3 years ago
Read 2 more answers
rite a function to prompt the user to enter the information for one movie (title, release date, mpaa rating and number of stars)
vesna_86 [32]

Answer:

import java.util.*;

public class Movie {

   

   public static void main (String [] args) {

       

       System.out.println(movieInfo());

       

   }

   public static String movieInfo() {

       Scanner input = new Scanner(System.in);

       Scanner input2 = new Scanner(System.in);

       

       System.out.print("Enter the title: ");

       String title = input.nextLine();

       System.out.print("Enter the release date: ");

       String releaseDate = input.nextLine();

       System.out.print("Enter the mpaa rating: ");

       double mpaaRating = input2.nextDouble();

       System.out.print("Enter the number of stars: ");

       double numberOfStars = input2.nextDouble();

       

       return "Title: "+title+ "\nRelease Date: "+releaseDate+ "\nMPAA Rating: "+ mpaaRating+ "\nNumber of Stars: "+numberOfStars;

   }

}

Explanation

- Create a function called <em>movieInfo()</em> that returns a string, information about a movie

- Ask the user to enter the title, release date, mpaa rating and number of stars of the movie.

- Return these values at the end of the function

- Inside the main, call the function to see the information about the movie

7 0
4 years ago
Other questions:
  • Based on the relational model, create the database metadata as part the physical designphase.b)from the metadata, write the sql
    10·1 answer
  • ____ is an iterative software development process that focuses on team productivity and delivers software best practices to all
    13·1 answer
  • This type of brake fade is caused by the brake fluid becoming so hot that it boils:a. Fluid fade b. Hydraulic fade c. Heat fade
    7·1 answer
  • In this lab, you will write a function called numberGuessingGame(). When the function is called, it will do the following: gener
    13·1 answer
  • Write a program that reads a sequence of up to 20 pairs of employee names and IDs. Store the data in an object designed to store
    15·1 answer
  • Define a function UpdateTimeWindow() with parameters timeStart, timeEnd, and offsetAmount. Each parameter is of type int. The fu
    10·1 answer
  • Advancements in technology have made the global marketplace more accessible. True O False​
    11·2 answers
  • Plz I need the answer ASAP. I’ll mark brainliest
    5·1 answer
  • which scheduling algorithm allocate the CPU firt to the process that request the CPU first, (a) first come first serve,(b) short
    9·1 answer
  • Your connection to this site is not secure how to fix.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!