1. Engineering
  2. Computer Science
  3. you should also be commenting on each line of your...

Question: you should also be commenting on each line of your...

Question details

You should also be commenting on each line of your code, writing short descrs of the line is. Any printed values must be may not use array lists in this lab - you must use arrays for any creditt necompanled by a text description of what the values are. You asaties the inner product of two vectors is the sum of the products resulting from element- oth vectors must have the same number of dimensions. If u uiei+ wise multiplication, where b +...+ tnen and v viéi+ve+ Unen, then the Inner product of vectors u and v is As a quick example, the inner product of the two vectors is easily found as follows: u v (4 x 2)+(-3) x 7) + (5 x (-4))-33 Write a static method that takes in two vectors and outputs their inner product. Your method should print an error message if the vectors have different lengths. 2. Write a class called Words, which consists of a single instance vatiable wordArray, an array of String objects. Aside from the main) method, the class should contain a gethext ) method, which returns a random word from the vordArray instance variable and updates wordArray so that it no longer contains the chosen word. If there are no words in the array, it should return the string NONE. For example, if the main) consisted of the following public static void main(String args) string[l stringrray fokay, this, is, epic] Words wordArray new words (stringArray); for (int 1-0; i < 6; i++) System.out.print (wordArray.getlext ()); then the text is okay this epic NONE NONE would be returned (where NONE is returned twice since the method is executed 6 times in the for loop, and there are only 4 words in the initial array). Also known as the dot product, for those of you who have taken physics.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution