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
In which type of situation would it make sense to use edge computing?
ZanzabumX [31]

A type of situation in which it would make sense to use edge computing is: b. where critical decisions must be made on a split-second basis.

<h3>What is edge computing?</h3>

Edge computing can be defined as a distributed computing system that involves the deployment of computing and storage resources closer to the sources of data, so as to save time and enhance the decision-making process.

This ultimately implies that, a type of situation in which it would make sense to use edge computing is a scenario where critical decisions must be made on a split-second basis.

Read more on edge computing here: brainly.com/question/23858023

#SPJ1

<u>Complete Question:</u>

In which type of situation would it make sense to use edge computing?

a. where data is uploaded to a server at a scheduled time each week

b. where critical decisions must be made on a split-second basis

c. where users are in close proximity to the central data server

d. where there are few or no digital devices to capture

e. i don't know this yet

4 0
2 years ago
What does it mean by null in programming?
Marysya12 [62]
In computer programming<span>, </span>null<span> is both a value and a pointer. </span>Null<span> is a built-in constant that has a value of zero. It is the same as the character \0 used to terminate strings in C. </span>Null<span> can also be the value of a pointer, which is the same as zero unless the CPU supports a special bit pattern for a </span>null<span> pointer.</span>
8 0
3 years ago
WILL GIVE BRAINLIEST AND 30 POINTS!! NEED ASAP!!!!
kotykmax [81]

Answer:

Explanation:

1. In tabletop games and video games, game mechanics are the rules that guide the player's moves or actions, as well as the game's response to them.

5.User interface is about the visual design and the information designs around the screens while the User Experience is about the whole experience and not only about the screen. User interface is mainly focused on the product while User experience on the other hand mostly focuses on the user and their journey through the product.

5 0
3 years ago
List two ways that search engines and electronic databases are similar and three ways that search engines and electronic databas
antoniya [11.8K]

Answer:

Explanation: search engine uses system algorithm to search out items or information as required by the user. Example is google, chrome.

Data base are archives where information could be retrieve. Its contain information such as publications, abstract,journals.

Search engine provides wide range of information depending on you request while database are mostly for academics related materials.

Data base- A good place to generate this information is library, archivals while journal, publiications are kept while search engine can be used anywhere you have an internet facilities.

In a data base, information is searched in an organized way. The collections are already well arranged in different cubicle search engine provides wide range of information not organized.

Data base may contain more complex information not easily understood, search engine provides more elaborate answers.

Similarity of the two is that they both provide information.

They are both reliable.

School library is an example of where journals and publication are kept and can be retrived.

6 0
4 years ago
Read 2 more answers
If you wish to maintain a consistent style to all the documents you create, it would be helpful to use a _​
kakasveta [241]

Answer:Apply a consistent look across the whole document instead of having to format each section individually.Automatically number section headers.Apply same font to the entire text body.Apply the same font to header sections.Use a consistent paragraph spacing.Pick a default color scheme for SmartArt, charts, and shapes.Pick from a number of pre-designed styles use them as your own and modify them.

Read more on Webcache.googleusercontent.com - https://webcache.googleusercontent.com/question/1639566#readmore

Explanation:

tht is the answer

7 0
3 years ago
Other questions:
  • A collection of related files that serves as a foundation for retrieving information is a: byte
    12·1 answer
  • Examples of language translator
    12·2 answers
  • Given numRows and numColumns, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print
    7·1 answer
  • Match the ocean floor feature with its characteristic.
    6·1 answer
  • _____________ helps to control and limit the number of consecutive request failures that cross a threshold. Review breaker Micro
    7·1 answer
  • When can screen tips be useful
    10·2 answers
  • When a binary tree is full to its next to last level and its leaves on the last level are filled from left to right the tree is
    14·1 answer
  • it has been said that television has little real educational value. what is your opinion on this issue?
    11·1 answer
  • . Why use a sensitivity analysis?
    14·1 answer
  • Create a method called nicknames that passes an array as a parameter. Inside the method initialize it to hold 5 names of your ch
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!