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
Question 1
Ivanshal [37]

Answer:

Q1. B

Q2. D

Explanation:

3 0
2 years ago
Read 2 more answers
In what way is your social media footprint related to your digital ID
ANEK [815]
Your social media footprint is literally your digital ID. Your digital ID is what you are online and your footprint is what you do.
3 0
4 years ago
Electronic type is often considered to be the latest step in the evolution of the written ______________.
Allisa [31]
It isn’t people but im really confused. I think its A but dont come at me if its wrong
4 0
3 years ago
What is data mining?1) A particular attribute of information 2) The common term for the representation of multidimensional infor
tiny-mole [99]

Answer:

option 4)

Explanation:

  • Data mining is characterized as a procedure used to extricate usable information from a bigger arrangement of any crude data. It suggests breaking down information designs in huge groups of data utilizing at least one programming.  
  • Data mining is utilized to find patterns and connections in the information so as to help settle on better business choices.  
  • Information or data mining can help spot deals patterns, create more astute advertising efforts, and precisely foresee client faithfulness.
3 0
3 years ago
Which Internet connection can have speeds around 1 Gbps?<br> Cable<br> DSL<br> Fiber<br> Satellite
Alexus [3.1K]
<h2>Answer:</h2>

<u>Fiber</u> Internet connection has speeds around 1 Gbps.

<h2></h2><h2>Explanation:</h2>

Fiber Internet connection is the modern way of transmitting and receiving data. As obvious from the name Optical Fiber consists of thin fibers that are extremely thin (as a human hair). They transmit data with the beam of light that make this transmission speedy as well as reliable. Therefore they provide  the download speed ranging from 25 Mbps to 1 Gbps.

Fiber Internet connection is considered best for the small businesses as it provides high bandwidth for transmission.  The best part of this connection is that it is made of glass and plastic that  do not conduct heat or electricity that means the fiber is safe from the damages as well.

<h3>I hope it will help you! </h3>
5 0
4 years ago
Other questions:
  • Select the correct answer.
    8·1 answer
  • How do I turn of the noise canceling feature on my beats studio wireless?
    13·1 answer
  • Assume a 16-word direct mapped cache with b=1 word is given. Also assume that a program running on a computer with this cache me
    6·1 answer
  • Some projectors use a connection technology called _______________ that enables long-range connectivity for uncompressed HD vide
    12·1 answer
  • Varied amount of input data Statistics are often calculated with varying amounts of input data. Write a program that takes any n
    8·1 answer
  • What is a quasi vpn?
    14·1 answer
  • Given a MxN matrix.Print the elements in odd rows from left to right and the elements in even rows from right to left.(Java or C
    11·1 answer
  • Why does my wifi keep disconnecting and reconnecting?
    9·1 answer
  • Part of the operating system core is responsible for controlling security, managing the file system, and providing a platform fo
    6·1 answer
  • Complete each sentence. To add a graphic to a Word document, start by clicking the tab. Next, click . Then, navigate to the grap
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!