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
Why are my texts green when texting another iphone.
Ede4ka [16]

Answer:

The green message background indicates the traditional SMS text message. It actually means a message that you have sent to someone else is through SMS message service instead of Apple iMessage

:

4 0
3 years ago
What happened to motion pictures when television became popular?
Sphinxa [80]
They became more popular and more advanced with their pictures
5 0
4 years ago
CIST 1122 Project 2 Instructions
NikAS [45]

Answer:

it is suppost ro be at

least 20 tb

Explanation:

5 0
3 years ago
Does a newer game work on older computer
babunello [35]
I don't think so because the old computers may have not been to date as what we have now but check it out and see.
5 0
3 years ago
What is the foundational domain for business
mr Goodwill [35]

a fundamental domain or fundamental region is a subset of the space which contains exactly one point from each of these orbits . It serves as a geometric realisation for the abstract set of representatives of the orbits . There are many ways to choose a fundamental domain .

hope this help

7 0
3 years ago
Other questions:
  • Web definition what means web
    9·1 answer
  • This type of method method performs a task and sends a value back to the code that called it:
    5·1 answer
  • ____ are programs that need to be attached to other files to install themselves on computers without the users’ knowledge or per
    5·1 answer
  • Which option should you select to ignore all tracked changes in a document? To ignore all tracked changes in a document, you sho
    15·2 answers
  • Two of the major sources used today for obtaining information to create computer maps are satellites and _____________.
    11·2 answers
  • Pls help me<br> first one to answer correctly gets brainly points
    6·2 answers
  • What can be done to solve unemployment problem?​
    11·1 answer
  • Vector images take up much less space when saved to a computer or storage device because computers and storage devices just need
    14·2 answers
  • What is the difference between
    14·1 answer
  • If you added the formula =SUM(B1:B5) to a spreadsheet, what would it do?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!