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 need to install a customized console on 10 computers. what is the best way to do that?
ICE Princess25 [194]
So you're going to simply create, copy, and paste!  You're going to create your first console on the first computer, and the you'll be left with a .mmc file which you're going to copy and paste to the other nine.  As long as you can get that file over through a shared server connection, you should be fine!
6 0
3 years ago
The command prompt found on Windows 7 and Windows 8 is very similar to the interface of what past operating system?
pav-90 [236]
The answer is (a.) DOS

DOS stands for Disk Operating System. MS-DOS is the operating system which has a command interface similar to the command prompt of Windows 7 and Windows 8. Among the options, DOS is the only OS which is has a command line interface. Others have graphics.
8 0
3 years ago
A server is a special kind of computer that manages access to resources such as files, applications, peripherals, emails, and we
Basile [38]

Answer:

true

Explanation:

6 0
3 years ago
Read 2 more answers
Adding videos to your website can be tricky because there may be problems making sure they will play in all
Volgvan
The sentence ends with the word 'devices'
4 0
3 years ago
Software that interprets commands from the keyboard and mouse is also known as the
Stells [14]
A) operating system
It is going to let you "operate" it using the mouse and keyboard
4 0
3 years ago
Read 2 more answers
Other questions:
  • Paragraph: Read the following two e-mail messages. In three to five sentences, explain why E-mail B is the more appropriate work
    5·1 answer
  • Suggest two other subtasks that may be performed in a dice game?
    15·2 answers
  • Help with this chart please
    9·1 answer
  • A page with no meaningful content that is full of ads and the webmaster makes money from if someone clicks on them is called____
    7·1 answer
  • Which statement accurately describes DTP programs?
    11·1 answer
  • 4. You are planning to buy a new couch for your family room. Before you leave for the furniture store, you measure the available
    11·1 answer
  • Which image file format is the best format to use for photographs on the Web
    15·1 answer
  • Hardware is found outside the system unit.​
    13·1 answer
  • processing C. have only one function, e.g. control traffic lights in a town, games machines 7 To create a formula, you first: A.
    13·1 answer
  • The users, groups, and roles that have access to a server are called ______________________________.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!