Question: Can someone modify my code to have this output package application; import java.util.Scanner; public class ringsuse { public static void main(String[] args) { Scanner sc
Can someone modify my code to have this output

package application;
import java.util.Scanner;
public class ringsuse { public static void main(String[] args) { Scanner sc = new Scanner(System.in) { int m, n; while (true) { System.out.println("Enter the number of rows (should be non-negative): "); m = sc.nextInt(); if (m >= 0) { break; } } while (true) { System.out.println("Enter the number of columns (should be non-negative): "); n = sc.nextInt(); if (n >= 0) { break; } }
int[][] arr = new int[m][n]; Random random = new Random(); for (int i=0; i double sum = 0, avg = 0; for (int i=0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
