Given an array containing three ints, return the sum of all the elements. It is safe to assume that the array always has at least 3...
CodeWorkout Sample Exam - Arrays
Score: 0 / 16.0
Sample APSCA Exam-style, hidden feedback.
Exercises
Given two int
arrays a
and b
, each with two elements, return a new array with four elements containing all the elements of a
followed by...
Write a function in Java that takes an int
array as its parameter and returns the number of even int
s it contains. Note: the %
"mod"...
Given an int[]
array, write a function that returns an array where all the 10's have been removed. The remaining elements should shift...
Return the centered average of an array of int
s, which we'll say is the mean average of the values, except ignoring the largest and...
Given an array of int
s, return true
if the sum of all the 2's in the array is exactly 8.
Given an array of int
s, return true
if the array contains a 2 next to a 2 somewhere.
Given an array of integers and an integer target
, return a count of the number of times the target
value occurs in the array.