Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help creating code for this assignment if you look at the picture and withi

ID: 3814969 • Letter: N

Question

Need help creating code for this assignment if you look at the picture and within the code will have tasks and will show what to do.

public class DotProduct
{
public static void main(String[] args)
{
// Insert your Identification String as a comment below.
//

// create the array A exactly as shown
int[][] A = { {10,55,4,89,39} , {45,9,49,98,23} , {4,8,90,23,9} , {8,32,80,2,31} };

// create the array B exactly as shown
int[][] B = ___________________________________________________________________;

// prepare the product array C, currently empty (filled with 0's)
int[][] C = __________________;

// compute the dot product of A's row 2, and B's column 1

int sum = ___________;

for (int i=__________; i <= __________; __________)
{
sum = sum + A[____][____]*B[____][____];
}

// set the value of C[2][1]
C[___][___] = ____________;
  
System.out.println(_________);
  
} // end main
} // end class

A 5.13 Lab 5b Due 11-Apr-17 5.14 Lab5c Due 11-Apr-17 Students: This content is controlled by your instructor, and is not zyBooks content. Direct questions or concerns about this content to your instructor lf you have any technical issues with the zyLab submission system, use the "Trouble with lab?" button at the bottom of the lab. Objectives Use 2-dimensional arrays to represent matrices. Compute the product of the matrices and store the data in a new 2-dimensinal array. Print the product of Matrix A Row 2 and Matrix B Column 1. Background Reading Zy Books Chapter 5 Finding the product matrix of two matrices In mathematics, physics, and computer animations, it is often necessary to multiply two "matrices." (A "matrix" is a grid of numbers, similar to a two- dimensional array in programming). Consider the following two matrices, A and B. Matrix A 0 1 2 4 0 10 55 4 89 39 1 45 9 49 98 23 2 8 90 23 9 8 32 80 20 31 Matrix B 0 1 2 0 40 1 16 1 90 3 7 2 9 2 22 3 44 35 60 18 67 21 You want to multiply A and B, to find the product matrix C. For ease, assume that (for now) you only want to compute the value at row 2, column 1, in the product matrix C:

Explanation / Answer

HI, Please find my implementation.

public class DotProduct

{

   public static void main(String[] args)

   {

       // Insert your Identification String as a comment below.

       //

       // create the array A exactly as shown

       int[][] A = { {10,55,4,89,39} , {45,9,49,98,23} , {4,8,90,23,9} , {8,32,80,2,31} };

       // create the array B exactly as shown

       int[][] B = { {40,1,16} , {90,3,7} , {9,2,22} , {44,35,60}, {18,67,21} };

       // prepare the product array C, currently empty (filled with 0's)

       int[][] C = new int[4][3];

       // compute the dot product of A's row 2, and B's column 1

       int sum = 0;

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

       {

           sum = sum + A[2][i]*B[i][1];

       }

       // set the value of C[2][1]

       C[2][1] = sum;

       System.out.println(sum);

   } // end main

} // end class

/*

Output: 1616

*/

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote