Question: this is for java Lab 8.2.2 Find Average of Input Row Select a code solution from the Guided Practice Files provided and modify it to



this is for java
Lab 8.2.2 Find Average of Input Row Select a code solution from the Guided Practice Files provided and modify it to load data from a file, input from the keyboard a row value, and then find and output the average of that row. Provide an input protection loop to repeatedly prompt for a valid input value until one is entered, and then produce the desired output. Define and use a new method in the Traversals class called rowAvg, similar to colAvg, which receives the grid and row number as parameters, calculates and returns the average of the provided row. Use the data file provided for input, 2DArrint.dat. X 2DArrint.dat 4 5 2 6 7 4 3 9 8 5 1 3 4 8 2 3 5 2 9 5 6 4 Data File - 2DArrInt.dat Run the program twice, once using two values, first a -1, then 1, and then again using 6, and then 2, producing the runs shown below. The grid should be output first, aligned as shown in columns of width four, right justified. The output should show the column input protection loop sequence, declaring invalid output and repeating the prompt as necessary, and then produce the final output report as shown for a valid column input. report as shown for a valid column input. Output for Lab 8.2.2 Find Average of Input Row 7 2 9 4 2 6 8 8 9 UNU 4 1 3 6 3 3 5 4 Enter a row number ==>-1 Invalid row number. Try again. Enter a row number ==> The average of the values in row 1 is 5.2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
