Question: 1 public class NumEqual { 2 / / Write a method named numEqual which takes two parameters: 3 / / - An array of integers
public class NumEqual
Write a method named numEqual which takes two parameters:
An array of integers
A single integer
This method will return the number of times the single
integer appears in the array of integers. For example,
if the array contained the elements:
and we were given as the single integer, then this
would return because appears in the above array
three times.
As another example, consider the following array:
If the single integer given were this would return
since does not appear in the above array.
If given an empty array, this should return since
no elements are contained in an empty array.
The next portion will require you to write a test
suite for the above code. If you want, you can
define a main method that does whatever you'd like
to informally test numEqual. You do NOT need
to define main, and I will not look at main during
grading.
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
