Question
=================== I need help to solve this ============= ====== Arrays ARRAY FUN HOUSE I =========== Lab Goal : This lab was designed to teach you
=================== I need help to solve this =============
====== Arrays ARRAY FUN HOUSE I ===========
Lab Goal : This lab was designed to teach you how to use an array. ==================
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, 7] [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,7]
Sample Output : [7, 4, 10, 0, 1, 7, 6, 5, 3, 2, 9, 7] sum of spots 3-6 = 14 sum of spots 2-9 = 34 # of 4s = 1 # of 9s = 1 # of 7s = 3 new array with all 7s removed = [4, 10, 0, 1, 6, 5, 3, 2, 9] # of 7s = 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,7] sum of spots 3-16 = 76 sum of spots 2-9 = 46 # of 0s = 2 # of 3s = 2 # of 7s = 9 new array with all 7s removed = [4, 2, 3, 4, 6, 8, 9, 0, 10, 0, 1, 6, 5, 3, 2, 9, 9, 8] # of 7s = 0
basic array code
int[] array = {3,4,5,65,6,7,8,81};
for(int i=0; i
{
out.println(array[i]);
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started