Question: There are two files attached to this assignment / DO NOT TOUCH RUNNER FILE : /**U8_L1_Activity_Two.java** public class U8_L1_Activity_Two { // Write multTable method as

There are two files attached to this assignment / DO NOT TOUCH RUNNER FILE :
/**U8_L1_Activity_Two.java**\
public class U8_L1_Activity_Two {
// Write multTable method as described in the assignment
}
===============================================
/**runner_U8_L1_Activity_Two.java**\
import java.util.Scanner; public class runner_U8_L1_Activity_Two{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); System.out.println("Enter number of rows:"); int rows = scan.nextInt(); System.out.println("Enter number of columns:"); int cols = scan.nextInt(); System.out.println(); int[][] mat = U8_L1_Activity_Two.multTable(rows, cols); for(int[] r : mat){ for(int n : r){ System.out.print(n + "\t"); } System.out.println(); } } }
Write a public static method named multTable which returns a 2d array which represents a multiplication table. Each element in the array should be equal to the product (multiplication) of the indices of the cell. The method should take 2 parameters which are equal to the number of rows and number of columns of the multiplication table. For example the call multTable(6,4) should return the array represented by the table below: 0 0 0 0 0 1 2 3 O 2 4 6 0 3 6 9 0 4 8 12 0 5 10 15 Write your multTable method in the U8_L1_Activity Two class. Use the runner class to test your method but do not add a main method to your U8_L1_Activity Two.java file or your code will not be scored correctly
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
