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
Charra [1.4K]
3 years ago
11

Write the method public static doublell quizAverages (double (1 scores). which takes a 2D array of doubles that represent quiz s

cores for students in a course and returns an array of quiz averages. Specifically, each column represents a quiz, and each row represents a student in the class. Therefore, what the method returns is an array of column averages, essentially. Assume that all students take the same number of quizzes
Computers and Technology
1 answer:
Helga [31]3 years ago
8 0

Answer:

  1. import java.util.Arrays;
  2. public class Main {
  3.    public static void main(String[] args) {
  4.        double [][] studentScores = {
  5.                {78, 40, 97},
  6.                {89, 90, 68},
  7.                {70, 35, 88}
  8.        };
  9.        System.out.println(Arrays.toString(quizAverages(studentScores)));
  10.    }
  11.    public static double[] quizAverages(double [][] scores){
  12.        double average[] = new double[scores[0].length];
  13.        for(int col = 0; col < scores[0].length; col++){
  14.            double sum = 0;
  15.            for(int row =0; row < scores.length; row++){
  16.                sum += scores[row][col];
  17.            }
  18.            average[col] = sum / scores[col].length;
  19.        }
  20.        return average;
  21.    }
  22. }

Explanation:

The solution code is written in Java.

Firstly, create a static method that take one input parameter, double type two dimensional arrays and this method will return one array of average as required by question (Line 11).

In the method, declare a double type array and initialize its size with the length of the column of the input scores array (Line 12).

Create a double layer of for loop with outer loop to iterate through the column of the input score array and the inner loop to iterate through the row (Line 13-15). In the outer loop, create a sum variable to hold the value of summation for each column (Line 14). In the inner loop, increment the sum variable with the score in each row (Line 16). After finishing one inner loop cycle, the sum is divided by the length of column and assign it to an item of average array in outer loop before proceed to the next round of outer loop to repeat the same process (Line 18).

At last return the average array (Line 20).

We can test the method using a sample data (Line 4-8) and print out the output returned by the method (Line 9).  

You might be interested in
What is mean by computer ?where it is used?​
dem82 [27]

Answer:

computer is a set consisting of hardware and software that perform specific set of instructions

Explanation:

thy are used in hospitals, institute,hotels

4 0
3 years ago
If I put a short clip from a copyrighted video to Facebook and make it only viewable to friends, is that illegal?
nirvana33 [79]
No thats not illegal, because it is a copyright. And this is not for school.XD
7 0
4 years ago
In Python, programmers use square brackets and an index range to slice multiple characters from a string.
il63 [147K]
(True) jgjgjgbfbfbfbdvdvdvdv
4 0
3 years ago
Read 2 more answers
Lucinda is a network manager. She wants to set up a small office computer network so that it will not be affected at all by elec
Katena32 [7]

Answer:

The network media she should use is;

E. Shielded twisted-pair

Explanation:

A network connection that will not be affected by electrical or electromagnetic interference is a shielded twisted pair cable

Electromagnetic interference, EMI, is an externally originating disturbance that has an impact on electrical circuits through electromagnetic induction, direct conduction, or electrostatic coupling, with the possible effect of circuit degradation or disruption

EMI can be prevented by the use of shielded twisted pair (STP) cabling that provides a barrier that reduces the effect of external electromagnetic fields and transports the current induced to the ground through a grounding wire

4 0
3 years ago
Which of the following does not describe local alignment algorithm?
swat32

Answer:

The answer is "Option a".

Explanation:

A score can be detrimental. When an element has a score below zero, it means, that the sequences up to this point have no correlations, that are set to zero and its effects the previous alignment is excluded. Thus, alignment can be further found in every position later in the calculation. and other options are incorrect that can be described as follows:

  • In option b, In this option the score can be negative, that's why we can't set its value.
  • In option c, The first row and column must contain some value it can't be 0, that's why it is not correct.
  • In option d, It will start with a lower score and ends with a higher score, that's why it is not correct.

8 0
3 years ago
Other questions:
  • The search engine that makes it easy to find high-quality Web resources by combining Internet technology with traditional librar
    9·1 answer
  • URGENT!! You decide not to use any recipes or information from the "Don't Be an Animal Murderer" Web site. What characteristic o
    7·2 answers
  • You are the project manger for Xylophone Phonics. It produces children's software programs that teach basic reading and math ski
    11·1 answer
  • Which of the following refers to the data analysis software and interactive software that allow managers to conduct analyses and
    6·1 answer
  • Seven Features of computer aids design software
    6·1 answer
  • A security policy is a?
    11·2 answers
  • A collection of code makes up which of the following?
    14·2 answers
  • After months of hard work, the big day has finally arrived, and your software will be produced and distributed. Which phase of t
    15·1 answer
  • Which tab allows you to review the slideshow timings?<br> O Home<br> O View<br> O Review<br> O File
    7·1 answer
  • How many times is the second for loop going to loop in this block of code? Write your answer in numeric form in the box provided
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!