1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
guajiro [1.7K]
3 years ago
10

Write a recursive, int-valued method named productOfOdds that accepts an integer array, and the number of elements in the array

and returns the product of the odd-valued elements of the array. You may assume the array has at least one odd-valued element. The product of the odd-valued elements of an integer-valued array recursively may be calculated as follows: If the array has a single element and it is odd, return the value of that element; otherwise return 1. Otherwise, if the first element of the array is odd, return the product of that element and the result of finding the product of the odd elements of the rest of the array; if the first element is NOT odd, simply return the result of finding the product of the odd elements of the rest of the array
Computers and Technology
1 answer:
lara [203]3 years ago
4 0

Answer:

Program source code found in explaination

Explanation:

Recursive int function of the asked question.;

int productOfOdds(int array[],int length) {

int product=1;

if(length==0)

return -1;

else if(length==1) {

if(array[length-1]%2!=0)

return array[length-1];

else

return 1;

}

else {

product=productOfOdds(array,--length);

if(array[length]%2!=0) {

product=product*array[length];

}

}

return product;

}

You might be interested in
The purpose of the trusted platform module is:
Elza [17]
A Trusted Platform Module is a specialized chip on an endpoint device that stores RSA encryption keys specific to the host system for hardware authentication. Each TPM chip contains an RSA key pair called the Endorsement Key. The pair is maintained inside the chip and cannot be accessed by software.
6 0
2 years ago
Read 2 more answers
Victoria has a .... of playing with her hair when she gets nervous​
IrinaK [193]

Answer:

Victoria has a tendency of playing with her hair when she gets nervous.

Explanation:

I believe this is what you are asking for.

:))))

6 0
3 years ago
Contains the instructions your computer or device needs to run programs and apps
gogolik [260]

Answer:

Settings

Explanation:

If your asking for instructions, there are to many, but if your looking for the settings you should be able to find it, it's easy to find. The settings app that comes on hp Windows computers have most of the answers on how to modify and change and fix things on your computer.

3 0
3 years ago
I need advice, please try to give a full paragraph and include a p r o s and c o n s list, no l i n k s please, it would mean so
Vlad [161]

Answer:

I think you should do what are passionate about. therefore it might gain more followers. Also so it's not boring and it's enjoyable for you. also it will be easier for you to do. the pros are you will put in extra efforts, it will make you happy, it will workout longer, it can help you grow as a person. the cons are you may lose followers, it may be hard to think of content, you might not make money, people may try to bring you down.

i think you should make a different account and try it. either make another account for art or make another for vlogs.

But honestly just try it out and see how it goes.

Explanation:

7 0
2 years ago
When a business is using methods that help it use its time and resources the best they can, what are they exercising?
maria [59]
<span>B. Efficiency

(</span><span>effective training </span><span>techniques)</span>
3 0
3 years ago
Read 2 more answers
Other questions:
  • You find that you are missing a very important file. After much searching, you have determined that it is no longer on your comp
    13·2 answers
  • With _______, applications are owned, delivered and managed remotely by one or more providers over the Internet or an intranet,
    15·1 answer
  • What are the methods of identifying publicly switched networks?
    14·1 answer
  • A user contacted the help desk to report that the laser printer in his department is wrinkling the paper when printed. The user
    5·1 answer
  • How would you justify using cloud computing?
    12·1 answer
  • Steps in the systems development life cycle​
    15·2 answers
  • Knowing the meaning of the acronym WAS I WHY can be most helpful to you when you?
    14·1 answer
  • What was original name<br> whoever answers first gets brainly crown
    9·1 answer
  • Your supervisor has asked you if it is possible to monitor servers for potential port scans via SNMP. What two OIDs can you prov
    13·1 answer
  • A web application with an SQL server database is found to be compromised by an attacker. On examination, the email IDs of the da
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!