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, 21.06.2019 14:20
Once starbucks had established its presence in thousands of cities internationally, the company sought to increase the number of purchases by existing customers with a strategy that led to new in-store merchandise, including compilation cds and high-speed wireless access.
Answers: 1
question
Computers and Technology, 22.06.2019 00:30
Which of the following methods could be considered a “best practice” in terms of informing respondents how their answers to an on-line survey about personal information will be protected? respondents are informed that investigators will try to keep their participation confidential; however, confidentiality cannot be assured. respondents are informed that a research assistant will transfer all the research data to a password-protected computer that is not connected to the internet, via a usb flashdrive. the computer is located in a research team member’s office. the investigator uses the informed consent process to explain her institution’s method for guaranteeing absolute confidentiality of research data. the investigator uses the informed consent process to explain how respondent data will be transmitted from the website to his encrypted database without ever recording respondents’ ip addresses, but explains that on the internet confidentiality cannot be absolutely guaranteed.
Answers: 1
question
Computers and Technology, 22.06.2019 22:00
Discuss the ways in which electronic information associated with payments is addressed in terms of security. include encryption, secure sockets layers, and secure electronic transactions in your discussion. are there any other ways that consumers and businesses can keep their payment information secure in an electronic commerce environment? do you feel that your information is safe when conducting electronic business? why or why not?
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Jake really works well with numbers and is skilled with computers but doesn't work well with others. which of the jobs discussed in this unit might be best for jake? why?
Answers: 3
You know the right answer?
Which of the following answer choices best describes the algorithmic purpose of method num? /** Pre...
Questions
question
Arts, 08.06.2021 19:40
question
Mathematics, 08.06.2021 19:40
question
Mathematics, 08.06.2021 19:40
question
Mathematics, 08.06.2021 19:40
question
Mathematics, 08.06.2021 19:40
Questions on the website: 13722360