Question: Consider an array of java int primitives such as the following: int scores [ ] = { 1 0 , 4 0 , - 1
Consider an array of java int primitives such as the following:
int scores;
Write Java methods to do the following, using the given names. You may assume that the scores array in the parameter is not empty.
public int oddAndEven int scores :
This method takes the input array scores and returns an int array of size in which the th value is the number of odd numbers in the array, and the st value is the number of even numbers in the array.
public boolean containsX int scores, int x :
This method returns true if the scores array contains the value x and returns false if it does not.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
