Question: I need to create an array to make that output. How would I do that with the code provided? Runner: // A+ Computer Science -

I need to create an array to make that output. How would I do that with the code provided?
Runner:
// A+ Computer Science - www.apluscompsci.com //Name - //Date - //Class - //Lab -
import java.util.Arrays;
public class ArrayFunHouseRunner { public static void main( String args[] ) { int[] one = {4,10,0,1,7,6,5,3,2,9};
System.out.println(Arrays.toString(one)); System.out.println("sum of spots 3-6 = " + ArrayFunHouse.getSum(one,3,6)); System.out.println("sum of spots 2-9 = " + ArrayFunHouse.getSum(one,2,9)); System.out.println("# of 4s = " + ArrayFunHouse.getCount(one,4)); System.out.println("# of 9s = " + ArrayFunHouse.getCount(one,9));
int[] two = {4,2,3,4,6,7,8,9,0,10,0,1,7,6,5,3,2,9,9,8,7};
//add test cases
} }
Other Code:
// A+ Computer Science - www.apluscompsci.com //Name - //Date - //Class - //Lab -
import java.lang.System; import java.lang.Math;
public class ArrayFunHouse { //instance variables and constructors could be used, but are not really needed
//getSum() will return the sum of the numbers from start to stop, not including stop public static int getSum(int[] numArray, int start, int stop) { return 0; }
//getCount() will return number of times val is present public static int getCount(int[] numArray, int val) { return 0; }
public static int[] removeVal(int[] numArray, int val) { return null; } }
Lab Description : Write several array manipulation methods. One method will sum up a section of a provided array, another method will count up how many of a certain number occur in the array, and the last method will remove all of a certain value from the array. Sample Data : [7, 4, 10, 0, 1, 7, 6, 5, 3, 2, 9, 71 [7, 4, 2, 7, 3, 4, 6, 7, 8, 9, 7, 0, 10, 7, 0, 1, 7, 6, 5, 7, 3, 2, 7, 9, 9, 8,71 Sample Output : Files Needed :: [7, 4, 10, 0, 1, 7, 6, 5, 3, 2, 9, 7] ArrayFunHouse.java sum of spots 3-6 14 ArrayFunHouseRunner.java Sum of spots 2-9 34 # of 43 1 # of 93 1 # of 73 3 new array with all 73 removed [4, 10, 0, 1, 6, 5, 3, 2, 9] # of 73 0 = [7, 4, 2, 7, 3, 4, 6, 7, 8, 9, 7, 0, 10, 7, 0, 1, 7, 6, 5, 7, 3, 2, 7, 9, 9, 8,71 Sum of spots 3-16 76 sum of spots 2-9 46 # of Os 2 # of 33 2 # of 73 9 new array with all 73 removed [4, 2, 3, 4, 6, 8, 9, 0, 10, 0, 1, 6, 5, 3, 2, 9, 9, 8] # of 79 0 basic array code int[] array = {3,4,5,65,6,7,8,81); for fint i=0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
