First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).Then create a new Java application called "Scorer" (without the quotation marks) that declares a two-dimensional array of doubles (call it scores) with three rows and three columns and that uses methods and loops as follows.Use a method containing a nested while loop to get the nine (3 x 3) doubles from the user at the command line.Use a method containing a nested for loop to compute the average of the doubles in each row.Use a method to output these three row averages to the command line.

Question
Asked Nov 24, 2019
49 views

First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).
Then create a new Java application called "Scorer" (without the quotation marks) that declares a two-dimensional array of doubles (call it scores) with three rows and three columns and that uses methods and loops as follows.
Use a method containing a nested while loop to get the nine (3 x 3) doubles from the user at the command line.
Use a method containing a nested for loop to compute the average of the doubles in each row.
Use a method to output these three row averages to the command line.

check_circle

Expert Answer

Program:

import java.util.Scanner;

 

public class Scorer

{

 

public static void main(String args[])

 

{

 

double s[][] = new double[3][3];

 

get_Scores(s);

 

double avg[] = new double[3];

 

get_avg(avg,s);

 

dispaly_avg(avg);

 

}

 

private static void dispaly_avg(double[] avg)

{

 

for(int i=0;i<3;i++)

{

 

System.out.println("The average of row "+(i+1)+" is "+avg[i]);

 

}

 

}

 

private static void get_avg(double[] avg, double[][] s) {

 

double sum=0;

 

for(int i=0;i<3;i++)

 

{

 

for(int j=0;j<3;j++)

 

{

 

sum+=s[i][j];

 

}

 

avg[i]=sum/3;

sum=0;

 

}

 

}

 

private static void get_Scores(double[][] s) {

 

int i=0,j=0;

 ...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: Simplify the following Boolean function and expression, using four-variable maps  a) cF(w,x,y,z) = Σ...

A: Since you have posted multiple parts and have not specified which part needs to be answered. So, we ...

question_answer

Q: The following words have three consecutive letters that are also consecutive letters in the alphabet...

A: Program to find the three consecutive letters which also in consecutive alphabetical order from a us...

question_answer

Q: Define a function CoordTransform() that transforms its first two input parameters xVal and yVal into...

A: This program takes two inputs from the user. The CoordTransform() function is used to transform the ...

question_answer

Q: Write the following program in C++:   Write a program that inputs one character, then display “yes” ...

A: The following is the source code in C++ for the above question. Comments have been added in the sour...

question_answer

Q: Express the complement of the following function in sum of minterms: a) F (A,B,C,D) = Σ (0,2,6,11,13...

A: Complement of the function in sum of mintermsF (A, B, C, D) = ∑ (0, 2, 6, 11, 13, 14)f = A1B1C + A1B...

question_answer

Q: consider the UDP header 12 03 00 0f 00 1e 10 wha tis the total length of the UDP ? (A) 32 bytes (b) ...

A: The UPD header basically has 4 parts, each part is of 2 bytes. That means following interpretation o...

question_answer

Q: Hi I am coding for java and I am trying to generate 20 numbers in the sequence of  1, 2, 4, 8, 16, 3...

A: In this java program,Print a 20 numbers series in the sequence of 1, 2, 4, 8, 16, 32, ...Print the 5...

question_answer

Q: PLEASE EXPLAIN ALL STEPS  In the following code, determine the values of the symbols this, that, and...

A: Before explaining the difference first user must know about the Assembly language.Assembly language:...

question_answer

Q: What are different datatypes used in c?

A: Definition of data type –Data types in C language are used to declare functions or to declare variab...