Write a complete java program called scorer

Assignment Help JAVA Programming
Reference no: EM13865132

Use a nested for loop to compute the average of the rows in each double. The code below works to populate the 2D array however cannot yet compute and print the averages. 

TEXT QUESTION: Write a complete Java program called Scorer that declares a 2-dimensional array of doubles called scores with three rows and three columns. Use a nested while loop to get the nine (3 x 3) doubles from the user at the command line. Finally, use a nested for loop to compute the average of the doubles in each row and output these three averages to the command line.

public static void main(String[] args) {

Scanner userInput = new Scanner(System.in);

int row;

int col;

final int NUM_ROWS = 3;

final int NUM_COLS = 3;

 

// Score array 3x3 doubles

double [][] ScoringMatrix = new double [NUM_ROWS][NUM_COLS];

 

ScoringMatrix[0] = new double[3];

ScoringMatrix[1] = new double[3];

ScoringMatrix[2] = new double[3];

 

for(row = 0; row < NUM_ROWS; row++) {

      for(col = 0; col < NUM_COLS; col++) {

         System.out.println("Enter a double: ");

         ScoringMatrix[row][col] = userInput.nextDouble();

}}

for(row = 0; row < NUM_ROWS; row++) {

       for(col = 0; col < NUM_COLS; col++) {

       /* Need code to average the rows and print the results of the mean calc */

}}

System.out.println("");

return;

}

Reference no: EM13865132

Questions Cloud

Write a function called makemat that will receive two row : Write a function called makemat that will receive two row vectors as input arguments, and from them create and return a matrix with two rows.
Effect of the watchs destruction on the parties : Explain how UCC Art. 2 would apply to these facts from the perspectives of A, B, C and D in terms of The legal relationships between A and B, A and C, B and C, and C and D;
Determine the sources of credit available : Determine the sources of credit available (where can you get credit, advantages and disadvantages of the types).
The world benefit from the general imposition of controls : Would the world benefit from the general imposition of controls on the movement of international finance?
Write a complete java program called scorer : Write a complete Java program called Scorer that declares a 2-dimensional array of doubles called scores with three rows and three columns. Use a nested while loop to get the nine (3 x 3) doubles from the user at the command line. Finally, use a nest..
Describe in very general terms the as-is business process : Describe in very general terms the as-is business process for registering for courses at your university. Collaborate with another student in your course and evaluate the process using problem analysis and root cause analysis.
Spin questioning system : The ADAPT questioning system is similar to the SPIN questioning system in that
What about the non-traditional channels of monetary policy : What do you think about the non-traditional channels of monetary policy? Could you provide an example of a variable or set of variables that could show non-traditional channels of monetary policy? Describe and explain.
Explain the meaning of array index out of bounds : Explain the meaning of "array index out of bounds".

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a login form

In this week's lab, we will create a login form, validate a user based on their login name and password, and allow them to access the system or not

  Determine which of a set of integers are prime numbers

Describes the trial division algorithm as Given an integer n, the integer to be factored, trial division consists of systematically testing whether n is divisible by any smaller number.

  Details of all advertisers registered with the service

Create a list of 6-7 different customers of both types with made-up details built in to the client program - display the details of all advertisers registered with the service,

  Program produces 1000 integer ranging

Then your program produces 1000 integer ranging from 1to 10000 in the array and then sort them in ascending order and then print the result into data.txt file. (You may list integers separated by space or new line)

  Alter the prototype form page by javascript function

Alter the prototype form page so that when JavaScript function has verified that all the required fields have been filled, cookie is added to user's computer.

  Write a java application that allows the user to read

Write a java application that allows the user to read, validate, store, display, sort and search the internet account number (integer number), usage (integer number) and cost (double number) for N customers. N should be declared as a constant and it ..

  Determine values of the side of triangle

Enter 3 integers and determine if these 3 values make up the sides of a triangle. If any side is

  Methods are commonly used to break a problem down into

methods are commonly used to break a problem down into small manageable pieces. a large task can be broken down into

  Prepare a program that constructs a binary tree and

prepare a program that constructs a binary tree and traverses the tree in pre-order in-order and post-order methods.

  The bookstore wants you to make an object-oriented model

student bookstore at pleasant creek community college situation the bookstore staff at pleasant creek community college

  Design an abstract data type in java

Design an abstract data type in Java that represents a musical pitch

  Graphics program that draws 12 strings

Write a graphics program that draws 12 strings, one each for the 12 standard colors, besides Color.WHITE, each in its own color. Provide a class ColorNameViewer and a class ColorNameComponent.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd