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
A network technician is setting up a wireless access point in the front office of a small company. The technician needs to disab
VladimirAG [237]

Answer:

He should disable UPnP technology to disallow devices to dynamically add themselves to the network without configuration.

Explanation:

  • UPnP stands for Universal Plug n Play.
  • It is an easiest way that allows gadgets to find all other devices connecting to your network.
  • This can also modify router settings to allow devices from outside the network to access the router.
  • External IP address can also be obtained by the gadget and a new port forwarding map can be set
  • So from all perspectives, UPnP is an open invitation for hackers to scan for the ports and hack into the device.
  • UPnP is a vulnerability to the secure system
6 0
3 years ago
Why we need each section of prologprogram?
evablogger [386]

Answer:

Prolog program are used in the artificial intelligence and the web development in a systematic manner process. As, it is also sometimes known as declarative language which basically consist of some facts and list. Prolog program are divided into the sections that are:

  • Domain sections
  • Clauses sections
  • Predicates sections
  • Goal sections

We need each section of the prolog program because all the sections introduced the systematic program and performed there particular functions so by using all these processing steps an efficient function are formed.

6 0
3 years ago
1. What are the advantages and disadvantages of the digital darkroom as compared to a regular
ki77a [65]

Answer:

The advantages of a digital darkroom is that it allows the photographer to make minor changes to improve a photograph. The disadvantage is that the more you want your picture to come out better you would need to waste your time or be patient to get the picture and buy a better camera.

4 0
3 years ago
Which statement will read an entire line of input into the following string object?
Solnce55 [7]

Answer:

getline(cin, address);

Explanation:

Given

String object: address

Required

Statement that reads the entire line

The list of given options shows that the programming language is c++.

Analysing each option (a) to (e):

a. cin<<address;

The above instruction will read the string object until the first blank space.

Take for instance:

The user supplied "Lagos state" as input, only "Lagos" will be saved in address using this option.

b. cin address:

This is an incorrect syntax

c. getline(cin,address);

Using the same instance as (a) above, this reads the complete line and "Lagos state" will be saved in variable address

d. cin.get(address);

address is created as a string object and the above instruction will only work for character pointers (i.e. char*)

<em>From the above analysis, option (c) is correct.</em>

6 0
2 years ago
What operating system do you use on your personal computer or mobile device
soldier1979 [14.2K]

The most popular Operating Systems are:

Android

IOS

Windows

5 0
3 years ago
Other questions:
  • A
    12·1 answer
  • This is a text message that is stored on a user's computer by a Web server that helps trace the user's browsing habits. a. Scrip
    14·1 answer
  • "Save" or "save as" can be used interchangeably and have no unique features.<br> True<br> False
    12·2 answers
  • Fill in the blank: _________ is Google’s machine-learning artificial intelligence system that interprets people’s searches to fi
    9·1 answer
  • . How to insert Section Break in Microsoft word 2016 ?
    14·1 answer
  • The Leal button is located in the
    7·1 answer
  • How does the technology work
    10·2 answers
  • What are benefits of virtualizing servers ?
    5·1 answer
  • A government agency is getting rid of older workstations. The agency will donate these workstations, along with other excess com
    9·1 answer
  • Which access object cannot be used to enter or edit data
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!