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 secure evidence locker is located at the ____.
olga55 [171]
The data recovery lab

Data recovery can be done in special rooms called data recovery labs. Data that has been salvaged, lost, or inaccessible from removable media or secondary storage can be accessed in a normal way. Recovery of this kind may be required due to the physical damage caused.

 

 

 





5 0
3 years ago
Looking at the response vehicles (pictured above), explain two options you have in order to abide by the Move Over law,
Nesterboy [21]

Answer: two options I have in order to abide by the move over law is to either move over or slow down. You must move over a lane away from stationary emergency vehicles if it is safe to do so. If it is not safe to do so then the driver must proceed with due caution, with a safe speed for road conditions.Until the driver has passed the emergency vehicle.

Explanation:Let me know if this helped! (:

6 0
3 years ago
Read 2 more answers
A 32-bit computer has two selector channels and one multiplexor channel. Each selector channel supports two hard disks and two D
Anit [1.1K]

Answer:

Maximum Aggregate I/O Transfer Rate = 1630kb/s

Explanation:

Given

Transfer rate of

Disk Drive = 800Kb/s

DVD Drive = 700Kb/s

Printer = 10Kb/s

VDT = 2Kb/s

Units

DVD = 2

Hard Disk = 2

Printers = 2

VDT Channels = 5

Only one device at a time can be serviced on a selector channel

Both cannot be active at a time

So, the device with higher transfer rate will be granted access (Disk Drive, 800Kb/s)

Maximum aggregate I/O transfer rate in this system is calculated by:

Summation of transfer rate of each device

= 800 * 2 + 2 * 10 + 5 * 2

= 1600 + 20 + 10

= 1630kb/s

7 0
3 years ago
A page layout technique that often uses a percentage value for width is called ________.
masya89 [10]
It is called a fluid layout

A fluid web page typically is configured with percentage widths that sometimes take up 100% of the browser. They will use relative units like percentages instead of pixels and will often fill the width of the page regardless of what the width of the browser might be. They keep the same spatial weighting to all elements and works fine on different sizes of screens of similar sort. They define each area of an image layout perfectly.  




4 0
3 years ago
Which of the following is an example of how science can solve social problems?
Minchanka [31]

Answer:

It can identify the sources of polluted water.

Explanation:

Science can be defined as a branch of intellectual and practical study which systematically observe a body of fact in relation to the structure and behavior of non-living and living organisms (animals, plants and humans) in the natural world through experiments.

A scientific method can be defined as a research method that typically involves the use of experimental and mathematical techniques which comprises of a series of steps such as systematic observation, measurement, and analysis to formulate, test and modify a hypothesis.

An example of how science can solve social problems is that it can identify the sources of polluted water through research, conducting an experiment or simulation of the pollution by using a computer software application.

In conclusion, science is a field of knowledge that typically involves the process of applying, creating and managing practical or scientific knowledge to solve problems and improve human life.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Peter wants to query to determine the names of the students who scored more than 95 in the internal assessment test which functi
    7·1 answer
  • What technique creates different hashes for the same password? ccna routing protocols final answers?
    7·1 answer
  • When configuring a vpn server to automatically assign ​ip addresses to remote clients, how many ip addresses are in a single poo
    10·1 answer
  • 1. Why is it important for IT technicians to keep documentation on computers for which they are
    13·1 answer
  • Scanning low allows you to locate __________ before you hit them
    13·1 answer
  • 1. Write a method to measure sortedness of an array. The method header is:
    14·1 answer
  • Spark is electrical discharge in air, while air is mix of variety of gases what particles conduct electricity in gas
    12·1 answer
  • Access your Practice Lab titles Access your exercise content Reports and files Access your settings Access help and support Comp
    12·1 answer
  • Fire stick optimizing system storage and applications
    10·1 answer
  • What is control structure write it's types​ .
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!