Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question
100%

Please make the code do what the description says.

preLabC.java
1
import java.util.Random;
2 import java.util.StringJoiner;
3
4 public class preLabC {
5
6-
7
8
9
10
11
12
13
~45608192023
Y
17
23 }
public static int myMethod(MathVector inputVector) {
int valueAt5th Position -100000; // default value for integer
System.out.println("here is the contents object, inputVector: + inputVector);
// extract the value at the fifth position of the array in the object
// Remember: the count starts at 0. So the 5th position has an in
}
System.out.println("This is the value at position 5:
// return the integer value found at position 5 of the
return valueAt5thPosition;
of 4.
+ valueAt5thPosition);
array..
Description
A MathVector object will be passed to your method. Return the 5th element inside of that object.
If you look in the file MathVector.java you'll see there is a way to extract the value of one element in the
array contained inside a MathVector object:
/**
* Returns the element at the specified index.
*
* @param index the index of the element to return
* @return the element at the specified index
*/
public int at(int index) {
return array[index];
}
use it like myObject.at(4); to get the 4th element. You did similar operations (with a different syntax) with
Matlab.
What to reproduce this on your own machine? Here are some important files:
* preLabC.java (fill this in)
• MathVector.java (the class with all the methods that the student should explore)
MyTest.java (the JUnit testing file. Student can use this on their own computer if they wish)
expand button
Transcribed Image Text:preLabC.java 1 import java.util.Random; 2 import java.util.StringJoiner; 3 4 public class preLabC { 5 6- 7 8 9 10 11 12 13 ~45608192023 Y 17 23 } public static int myMethod(MathVector inputVector) { int valueAt5th Position -100000; // default value for integer System.out.println("here is the contents object, inputVector: + inputVector); // extract the value at the fifth position of the array in the object // Remember: the count starts at 0. So the 5th position has an in } System.out.println("This is the value at position 5: // return the integer value found at position 5 of the return valueAt5thPosition; of 4. + valueAt5thPosition); array.. Description A MathVector object will be passed to your method. Return the 5th element inside of that object. If you look in the file MathVector.java you'll see there is a way to extract the value of one element in the array contained inside a MathVector object: /** * Returns the element at the specified index. * * @param index the index of the element to return * @return the element at the specified index */ public int at(int index) { return array[index]; } use it like myObject.at(4); to get the 4th element. You did similar operations (with a different syntax) with Matlab. What to reproduce this on your own machine? Here are some important files: * preLabC.java (fill this in) • MathVector.java (the class with all the methods that the student should explore) MyTest.java (the JUnit testing file. Student can use this on their own computer if they wish)
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education