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

  Program that will calculate monthly mortgage payments

Consumers think of the term of the loan in years, not months.  It would still be good to tell them how many monthly payments they will be making.

  This project is designed to exercise all the java tools

This project is designed to exercise all the Java tools that you have learned about this term: classes/objects, variables, decision constructs, loops, arrays, encapsulation, overloading, inheritance, error handling, and application deployment.

  Need of arrays and list

why do we need arrays and list and why are they important?

  Find method of the class is passed each of the targets

How many calls to the recFind method of the ArraySortedList3 class are made when the find method of the class is passed each of the targets?

  Developing prototype applet for web inventory management

As a lead systems developer for iDev3, you have been assigned as a consultant to work with Wrigley Inc (the gum company). Your project consists of developing a prototype applet for web-based inventory management

  Test the invoice application

Study the error message and note the line number in the statement in the InvoiceApp class that caused the crash. Then click on the link to that line of the code.

  Eclipse or netbeans environments

As recommendation, you can try to use Eclipse or NetBeans environments that are used also for other courses as: Introduction in Java programming and Intermediate programming.

  Write a java application that prompts the user for input

Write a Java application that prompts the user for pairs of inputs of a product number (1-5), and then an integer quantity of units sold (these are two separate prompts for input values).

  Implementing inheritance by creating generic superclass

You will be implementing inheritance by creating a generic Racer superclass along with two subclasses called StreetTuner and HotRod. You will make the Racer class abstract and include the abstract method IsDead in the Racer class

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Write a recursive public method

Write a recursive public method in our BST class that returns a reference to the information in the node containing the smallest value in the tree. The signature of the method is

  Mutant bacterium-synthesize the amino acid tyrosine

Consider a mutant bacterium you have isolated which is unable to synthesize the amino acid tyrosine. You grow it in the presence of a chemical mutagen and isolate a single revertant, which is now able to grow in the absence of tyrosine

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