subject

Which of the following answer choices best describes the algorithmic purpose of method num? /** Precondition: i==0; */

public static int num(int[] ray, int i)
{
if( i >= ray. length ){
return 0;
}
if( ray[i] % 2 != 0 ){
return 1 + num( ray, i+1 );
}
else{
return 0 + num( ray, i+1 );
}
}

a. The method is counting the number of numbers in ray.
b. The method is counting the number of even numbers in ray.
c. The method is counting the number of occurrences of x in ray.
d. The method is counting the number of odd numbers in ray.
e. The method is summing all of the numbers in ray.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
Which two editions of windows 7 support 64 bit cpus? choose two out of professional, business, starter, or home premium.
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
Andrina writes letters that are regularly sent to hundreds of her company’s customers. because of this, she would like for the mail merge command to be in her quick access toolbar, and she wants it to be the first button on the left. what should andrina do to place the mail merge button there?
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
Who needs to approve a change before it is initiated? (select two.) -change board -client or end user -ceo -personnel manager -project manager
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Which is a possible benefit of having a good credit history? having a checking account low interest rate on a car loan high interest rate on a credit card offer bankruptcy
Answers: 1
You know the right answer?
Which of the following answer choices best describes the algorithmic purpose of method num? /** Pre...
Questions
question
Mathematics, 10.10.2021 18:20
question
Mathematics, 10.10.2021 18:20
question
Mathematics, 10.10.2021 18:20
question
Mathematics, 10.10.2021 18:20
question
Mathematics, 10.10.2021 18:20
question
Mathematics, 10.10.2021 18:20
question
Spanish, 10.10.2021 18:20
Questions on the website: 13722363