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 does the % find
Sever21 [200]

Answer:

The FIND function returns the position (as a number) of one text string inside another. If there is more than one occurrence of the search string, FIND returns the position of the first occurrence. FIND does not support wildcards, and is always case-sensitive.

Explanation:

4 0
2 years ago
What is an undirected graph?
ella [17]

Answer: An undirected graph is the graph that has the connection of the objects in the form of bidirectional edges.This graph is formed for by the attachment of the collection of the objects which get displayed in the form of network and thus, also known as the undirected graph.

The graph is formed by the nodes or objects getting connected and form edges or link(which is typically in the form of line).

.

5 0
3 years ago
What is Service Operations in ITIL​
Nostrana [21]

Explanation:

the objective of ITIL service operations is to make sure that IT services are delivered effectively and efficiently. the service operation life cycle stage includes the fulfilling of user requests, resolving service failure fixing problems and also carrying out routine operational tasks

7 0
3 years ago
Using the flowchart diagram, identify the decision point of this solution. Identify vendors. Calculate amount due. Determine dat
andreev551 [17]

Answer:

answer is "is there an early pay discount"

Explanation:

3 0
3 years ago
Read 2 more answers
The best way for you to communicate with the school is through
REY [17]
A. Because you can easily call the school without wasting too much time
4 0
2 years ago
Other questions:
  • Choose the two main capabilities involved in visual literacy
    13·1 answer
  • reate a class called Plane, to implement the functionality of the Airline Reservation System. Write an application that uses the
    5·1 answer
  • Print a countdown from n to 1 The function below takes one parameter: an integer (begin). Complete the function so that it print
    8·1 answer
  • Which of these would NOT be a valid Internet Control Message Protocol (ICMP) error message:
    6·1 answer
  • what social media application that affect our day to day activities, and how did it improve our skill
    9·1 answer
  • If you have 60fps on your laptop tell me one way you can go to 240fps
    14·2 answers
  • Recall the binary search algorithm.1. Using the algorithm/algorithmic environment, give pseudocode using a for loop.AnswerMy alg
    5·1 answer
  • Database accessibility DBA writes subschema to decide the accessibility of database.
    13·2 answers
  • An engineer has reported that a printer is no longer working and needs troubleshooting. You have been informed that there is a p
    9·1 answer
  • In a print statement, you can set the __________ argument to a space or empty string to stop the output from advancing to a new
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!