Question: Java - Description The MathVector.java file contains a class (MathVector). This class allows you to create objects in your program that can contain vectors (a
Java

- Description The MathVector.java file contains a class (MathVector). This class allows you to create objects in your program that can contain vectors (a 1D array) and perform actions on those vectors. This is useful for doing math operations like you would in your linear algebra class. preLabC.java 1- import java.util. Random; 2 import java.util.Stringjoiner; 3 4- public class prelabc { 5 5 public static Mathvector myMethod (int[] testvalues) { 7 8 // Create an object of type "Mathvector". 9 10 11 // return the Math Vector Object back to the testing script. 12 return Vectorobject; 13 14 } 15 16 ) } Your method should evaluate against two tests. These successful tests will look like this: : Dashboard / My courses LEEECS1021 X and 2 Object Oriented Programming from Sensors to Actuators Winter 2021-2022) / Moc Lab PPL Console connection closed (Running) C. activity Test 1 o Test 2 * c test) Success. student de returned PL RG expecting Defeription ES that Student returned [20, 20, , 9,90 Subson Educating the Mudent le Time: 0.00 RO 1 ) pr. Now, run the import java.ution evaluation 4- public class prela for marks publici Hot 1/ Greatest of the Chose of the 10-19 17.0.1.12 -17.0.1.12 13 L2 13 14 LS 15 MatHector vector Vector Gaject - Mothector(test): Step 1 Step 2 2 18 Description 1370940 What do you need to do in this exercise? You need to create an "instance of the MathVector object, VectorObject, in your method. If you do this correctly, your method will accept a 1D array of integers, testValues, feed it into the VectorObject and then return the VectorObject. If you look in the file Mathvector.java you'll see that this is one way in which i MathVector objects can be created (constructed): 24 25 * Creates a MathVector instance backed by the given array. 26 * @param source the array to use public MathVector(int[] source) { this.array = source; 24 * */ 27 28 29 30
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
