Question: AP Computer Science A Lab 8 Lab 8: One-Dimensional Arrays Note: All of your scripts must begin with a comment block that is similar to

 AP Computer Science A Lab 8 Lab 8: One-Dimensional Arrays Note:

AP Computer Science A Lab 8 Lab 8: One-Dimensional Arrays Note: All of your scripts must begin with a comment block that is similar to the following //File: fileName.java //Author: Your name here //Date: Today's date //Class: AP Computer Science A //Teacher: Mr. Giguere //Code Description: Insert short description of code (i.e. what it does) You should also be commenting on each line of your code, writing short descriptions of what the purpose of the line is. Any printed values must be accompanied by a text description of what the values are. You may not use array lists in this lab -you must use arrays for any credit 1. In mathematics, the inner product1 of two vectors is the sum of the products resulting from element- wise multiplication, where both vectors must have the same number of dimensions. If u - ui U22 + + tren and v = ulei + U22+ + vnn, 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 getNext ) method which returns a random word from the wordArray 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 (Stringl args) "epic"); String[] stringArray= {"okay", "this", "is", Words vordArray nev Words(stringArray); for (int i-0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!