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
Sam has created a fashion website. There are many subscribers to his website. He has added new blogs, pictures, and articles abo
marusya05 [52]

Answer:

Post advertisements on social media and message the subscribers.

Explanation:

There is no point in not promoting and putting forward the work that he has been doing. All of the given options are about promoting the content but Sam needs to choose the ones which are efficient and seem professional as well.

Posting advertisements about the website promotes the content on a wider base and helps in luring more and more people to the website.

Messaging or sending an email to the subscribers is a healthy of letting the subscribers about the updates and latest posts.

8 0
3 years ago
How to solve level 53 on rapid router?
alexgriva [62]

<img src=/static/game/image/actions/go.svg alt=' + ugettext(play= button)= += '= style=width: 4%;> ) def noPermissionMessage():

6 0
2 years ago
On a leading-trailing system technician A says that both shoes do equal work when stopping while going in reverse. Technician B
sleet_krkn [62]

Based on the scenario above about the leading-trailing system Both technician A and B are incorrect.

<h3>How many brake shoes function?</h3>

There are known to be two shoes function that are said to be working a way where both become either the trailing shoe or leading shoe based on whether the vehicle is moving forward or backward.

Therefore we can say that, Based on the scenario above about the leading-trailing system Both technician A and B are incorrect.

Learn more about trailing system from

brainly.com/question/14367881

#SPJ1

5 0
1 year ago
Sorting Records in a Form
Naya [18.7K]

Answer:

1. Open the form in the standard form view.

2. Put the cursor in the field to use for sorting.

3. Open the Home tab

4. In the Sort & Filter group, click ascending or descending

Explanation:

Took the test :)

7 0
3 years ago
Monica is writing a paper, and it needs to contain a certain amount of words. What Word Online feature can she use?IndentingProo
Greeley [361]

Answer:

Its word count so she knows how much words she is writing

Explanation:

7 0
2 years ago
Other questions:
  • What view is In a presentation program displays your slides in full screen mode
    6·1 answer
  • The use of computers to combine data from multiple sources and create electronic dossiers of detailed information on individuals
    8·1 answer
  • Which of the following statements is false? a. Classes (and their objects) encapsulate, i.e., encase, their attributes and metho
    15·1 answer
  • Importance of project risk management
    10·1 answer
  • FIND THE 6 ERRORS IN THIS RESUME 30 POINTS!!!!
    12·1 answer
  • Exchanging which type of data uses the least bandwidth?
    7·2 answers
  • A recommended cleaner for the bowls of coffee brewers is
    7·1 answer
  • What is an information technology? ​
    12·2 answers
  • Text,Audio and graphic is entered into the computer using
    9·1 answer
  • Which way do you swipe in ios to get to the control center
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!