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 feature is available to add a suggestion in the margin of someone else's document?​
Ksenya-84 [330]

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

The correct question is:

what feature is available to add a suggestion in the margin of someone else's document. The given features in this question are:

  • Annotation
  • Comments
  • Highlight and
  • Bookmark

The correct answer to this question is the Comments.

Because you can add comments in someone else's document and only Comments features in word document allow you add comments on the someone else's document.

While the other options are not correct because:

The Annotation works with grammar or writing, Highlight feature allows you to mark important information or text in your document. while Bookmark allows you to save your space in a document.

4 0
2 years ago
How can I master networking my home/business computer(s) - Tv's - iot devices and make the whole system as secure as possible?
vagabundo [1.1K]

Answer:

you can take guide from

hope this will help you....!

5 0
2 years ago
Should I learn Python, C++, C# or VB to start off programming games for Windows. Open to other language recommendations as well!
Svetllana [295]
In theory, you can of course use any language you like, but there are a few commonly used ones.
From your list it would be c++ or c#, because if you actually have the interest long term then those will be the languages used by the various "big"/well known/used engines.
I would suggest c#, because it can be used with the Unity engine, which has an enormous community with help resources especially to start out and learn to program or game development.
On the other hand I would also suggest JavaScript. It isn't used for any of the big title development, but for all the *.io games like slither and so on. When looking at such games you will quickly notice that they are generally much simpler (for example 2D not 3D), because game engines are just simpler in JavaScript. While this is obviously limiting it might help to get something simple actually working, instead of getting stuck in extra complexities and additional features until you lose your motivation.
The basic programming you learn is still the same, so after you have learned a language you can quickly pick up most others.
<span />
7 0
3 years ago
Write a c++ function, largestnum, that takes as parameters a double array and its size and returns the index of the last occurre
miv72 [106K]
Not a Question so how am i supposed to help with this problem
6 0
2 years ago
Suppose that you have the following definitions:
spin [16.1K]

Suppose that you have the following definitions:struct time Type struct tourTypen the variable destination of type your type are tourType input(){cout<<"Enter the city, distance and time in hr and min"<>destination.city name;

<h3>What is C++ statements?</h3>

Expression statements. These statements examine an expression for its aspect outcomes or for its go-back value. Null statements. These statements may be supplied in which a declaration is needed with the aid of using the C++ syntax however in which no motion is to be taken.

  1. #include
  2. #include
  3. the use of namespace std;
  4. struct timeType
  5. ;
  6. struct tourType
  7. ;
  8. tourType destination;
  9. tourType input(){
  10. cout<<"Enter the city, distance and time in hr and min"<>destination.cityName;
  11. cin>>destination.distance;
  12. cin>>destination.travelTime.hr;
  13. cin>>destination.travelTime.min;
  14. go back destination;
  15. }
  16. void display()cityName;
  17. d.distance = t->distance;
  18. d.travelTime.hr = t->travelTime.hr;
  19. d.travelTime.min = t->travelTime.min;">
  20. int main().

Read more about the variable :

brainly.com/question/2804470

#SPJ1

6 0
1 year ago
Other questions:
  • An _________ is a phrase formed from the first letters of words in a set phrase or series of words a. Acronymic sentence c. Basi
    7·2 answers
  • What is a way to Procter your social security number and other sensitive information from identity theft
    9·1 answer
  • To name a computed field, follow the computation with the word ____ and then the name you wish to assign to the field
    8·1 answer
  • Violations of security policies are considered to be a(n) __________ issue upon which proper disciplinary actions must be taken.
    7·1 answer
  • Which key combination will allow users to move to the top of a document?
    15·1 answer
  • Courses that enable students to begin jobs that require course completion certificates are know as
    8·1 answer
  • The sequence's insert member function normally puts a new item before the current item. What should insert do if there is no cur
    9·1 answer
  • You have implemented an access control method that only allows users who are managers to access specific data. Which type of acc
    11·2 answers
  • Try using the index method yourself now! Using the index method, find out the position of "x" in "supercalifragilisticexpialidoc
    9·1 answer
  • The technologist has recorded the red cell morphology as macrocytic. which mcv value would confirm this observation?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!