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
Gemiola [76]
3 years ago
5

In java I need help on this specific code for this lab.

Computers and Technology
1 answer:
rosijanka [135]3 years ago
8 0

Answer:

Explanation:

The following code is written in Java and creates the two methods as requested each returning the desired double[] array with the averages. Both have been tested as seen in the example below and output the correct output as per the example in the question. they simply need to be added to whatever code you want.

public static double[] rowAvg(int[][] array) {

       double result[] = new double[array.length];

     for (int x = 0; x < array.length; x++) {

         double average = 0;

         for (int y = 0; y < array[x].length; y++) {

             average += array[x][y];

         }

         average = average / array[x].length;

         result[x] = average;

     }

     return result;

   }

   public static double[] colAvg(int[][] array) {

       double result[] = new double[array[0].length];

       for (int x = 0; x < array[x].length; x++) {

           double average = 0;

           for (int y = 0; y < array.length; y++) {

               average += array[y][x];

           }

           average = average / array.length;

           result[x] = average;

       }

 

       return result;

   }

You might be interested in
You conduct an experiment to find the probability of a flipped coin landing on
AleksAgata [21]

Answer:

Experimental probability describes how frequently an event actually occurred in an experiment. So if you tossed a coin 20 times and got heads 8 times, the experimental probability of getting heads would be 8/20, which is the same as 2/5, or 0.4, or 40%.

5 0
3 years ago
Read 2 more answers
In order to be accredited by the Better Business Bureau, a business is required to publish a privacy notice on its website that
Svetradugi [14.3K]

Answer:

Explanation:Option D (Access)

7 0
3 years ago
A(n) ________ file contains data that has been encoded as text, using one of the computer's encoding schemes.
tangare [24]

Hello there

the answer is text

hope this helps

Queen Z

8 0
3 years ago
Read 2 more answers
First calculating device​
AnnyKZ [126]

Answer:

abacus is first calculating device

7 0
3 years ago
Read 2 more answers
What is Computer categories
MA_775_DIABLO [31]
Computer Categories are like

Supercomputers, mainframe computers, microcomputers, mobile computers, minicomputers.

I hope that this is the type of answer that you were looking for.
5 0
3 years ago
Other questions:
  • The word computer consists of 64 bits, which is equivalent to _____ bytes.
    5·1 answer
  • ou work as network administrator for an organization that has a Windows-based network. You want to use multiple security counter
    10·1 answer
  • What is required to control access to the file system using file and folder permissions on a windows based computer?
    8·1 answer
  • Digital dashboards provide the decision makers with a quick overview of key performance indicators and other key operational sta
    13·1 answer
  • Instead of terminating the series, the producers decided to extend it for an additional season. In the sentence above, which of
    13·1 answer
  • Drag each tile to the correct box.
    12·1 answer
  • I need some asap pls
    9·2 answers
  • Need help on Assignment 4: Evens and Odds
    5·1 answer
  • Stephanie would like to know the average number of regular hours worked by her employees. In cell B11, create a formula using th
    8·1 answer
  • What software application is most appropriate to use to create multimedia presentations?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!