Question: These questions are java Given the following method from the FinalExam class, what is the output?: public int mystery(int [] param1, int param2, int param3)
These questions are java
Given the following method from the FinalExam class, what is the output?:
public int mystery(int [] param1, int param2, int param3)
{
int ans = 0;
for (int i = 0; i < param2; i++)
{
if (param1[i] % param3 == 0)
ans++;
}
return ans;
}
| Question 11 of 24 4 Points What would be the output of the following Java code segment located in the FinalExam class? int [] arr1 = {8,3,4,12,10,9,4,6}; System.out.println(this.mystery(arr1,arr1.length,4));
Output:
| |||
| Question 12 of 24 2 Points Consider what the mystery method does. What would be a better name for the method?
| |||
| Question 13 of 24 2 Points Write a proper javadoc comment for this method. Also, Change the names of the parameters to appropriate meaningful names. |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
