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]
2 years ago
5

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

Computers and Technology
1 answer:
rosijanka [135]2 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
What chage command should you use to set the password for jsmith to expire after 60 days and give a warning 10 days before it ex
nata0808 [166]

chage -M 60 -W 10 jsmith Forces jsmith to keep the password 60 days before changing it and gives a warning 10 days before changing it.

<h3>Which command should you use to set the expiration date for a user account?</h3>

The “chage” command is used to modify the password expiry date of the user's account in which you can change the current status of the expiry date, set expiry date to lock the account, active and passive status, and warning days before the account get expired.

<h3>What is chage command Linux?</h3>

The chage command is self-described as the "change user password expiry information" utility. According to the chage man page: The chage command changes the number of days between password changes and the date of the last password change.

To learn more about chage command, refer

brainly.com/question/13084023

#SPJ4

7 0
1 year ago
What is meant by ‘LASER’?
Zanzabum
Light Amplification by Stimulated Emission of Radiation
5 0
3 years ago
Read 2 more answers
Will a debit card still work if i put stickers on it?
laiz [17]

Answer:

Explanation:

Yes, it may still be readable, but if they refuse to take it you have no ground to stand on. (If you obscure the signature, at least make sure the CVV is readable or reprinted on top.) The plastic covering should not interfere with the mag stripe.

8 0
3 years ago
Read 2 more answers
i'm actually really smart so if u need help just ask me or leave me a comment. im 16 and my name is lexi
kicyunya [14]
Umm okay...

The density of water is 1.0 g/cm^3
Which will float in water

A.) Ice (Density = 0.92 g/cm^3) Float or sink

B.) Wood (Density = 0.45 g/cm^3) Float or sink

C.) Bone (Density = 1.7 g/cm^3) Float or sink

If you help answer this it will be much appreciated thank you
8 0
3 years ago
Read 2 more answers
Can someone taught me? How to use this brainy apps la?​
Anna11 [10]
Okeh, So it basically helps you find answers for you homework and stuff and you can also answer people questions too and get points. You can get brainliest answer too. You can answer fake questions too but then you can be reported and the will delete your account
6 0
3 years ago
Other questions:
  • to prevent long page load time for pages containing images. It is best to use a compress file formatlike jpeg as well as appropr
    6·2 answers
  • The first step in creating photographs with good backgrounds is which of the following? Learning to see the background before ta
    11·2 answers
  • Design and implement your own simple class to represent any household item of your choice (toaster, fan, hair dryer, piano ...)
    11·1 answer
  • Help!!!!!!!!!!!!!!!!!
    11·1 answer
  • Who put forward the idea of nanotechnology to the world?​
    6·1 answer
  • Identify traits of entrepreneurs. Check all of the boxes that apply.
    11·1 answer
  • Universal Containers has two customer service contact centres and each focuses on a specific product line. Each contact centre h
    7·1 answer
  • What settings are available in the Properties dialog box of a message? Check all that apply.
    6·2 answers
  • Which of these is an example of a system?
    7·1 answer
  • Someone put malware on your computer that records all of your keystrokes. what aspect of security was primarily attacked? choose
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!