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
nadya68 [22]
3 years ago
12

Write a function solution that given an array a of n integers (between -100 and 100), returns the sign (-1,0,1) of product of al

l the numbers in the array multiplied
Computers and Technology
1 answer:
JulijaS [17]3 years ago
4 0

left[0]=a[0];

for(int i=1;i<=n-1;i++)

   left[i]=(left[i-1]*a[i])%M;

right[n-1]=a[n-1];

for(int i=n-2;i>=0;i--)

   right[i]=(right[i-1]*a[i])%M;

for query q

   if(q==0)

       return right[1]%M;

   if(q==n-1)

       return left[n-2]%M;

   return (left[q-1]*right[q+1])%M;

You might be interested in
Which of the following is considered a white collar crime?
irinina [24]

Answer:

The answer would be C if I am correct

Explanation:

The reason being is because white collar crimes are non-violent and usually are finance related and involves business or government things, so money laundering would make sense, i hope this helps

5 0
3 years ago
The process of analyzing data to extract information not offered by the raw data alone; it uncovers trends and patterns using te
anygoal [31]

Answer:

The correct answer to the following question is "Data Mining".

Explanation:

It is indeed a method that businesses that are used to transform the raw information towards valuable data. Corporations might learn something about their clients instead of using technology to analyze trends in large quantities of content to create more efficient campaigns, boost revenue as well as reduce costs.

  • It encompasses investigating as well as analyzing huge blocks of documentation to extrapolate useful behavioral patterns.
  • It constructs discernment about what actually happens in certain details, and is already teensy bit mathematical than scripting, but utilizes both.
5 0
3 years ago
Patient letters created from __________ use structured data and do not require a large amount of typing from the medical assista
umka2103 [35]
Templates I think. not sure
3 0
3 years ago
The Windows ____ window allows you to create the graphical user interface for your application.
DerKrebs [107]

The Windows GUI window allows you to create the graphical user interface for your application.

8 0
3 years ago
Create a method called nicknames that passes an array as a parameter. Inside the method initialize it to hold 5 names of your ch
Gre4nikov [31]
<h2>Answer:</h2>

    //======METHOD DECLARATION=========//          

    //method name: nicknames                                          

    //method return type: void                                            

    //method parameter: an array reference                    

    public static void nicknames(String [] names){      

       //initialize the array with 5 random names              

       names = new String[] {"John", "Doe", "Brian", "Loveth", "Chris"};

       //using an enhanced for loop, print out the elements in the array

       for(String n: names){

           System.out.print(n + " ");

       }

       

    }

<h2>Explanation:</h2>

The program is written in Java. It contains comments explaining important parts of the code. Kindly go through these comments.

A few things to note.

i. Since the method does not return any value, its return type is <em>void</em>

ii. The method is made public so that it can be accessible anywhere in and out of the class the uses it.

iii. The method is made static since it will most probably be called in the static main method (at least for testing in this case)

iv. The method receives an array of type <em>String </em>as parameter since the names to be stored are of type <em>String</em>.

v. The format of initializing an array manually should follow as shown on line 7. The <em>new</em> keyword followed by the array type (String), followed by the square brackets ([]) are all important.

vi. An enhanced for loop (lines 9 - 11) is a shorthand way of writing a for loop. The format is as follows;

=> The keyword <em>for</em>

=> followed by an opening parenthesis

=> followed by the type of each of the elements in the array. Type String in this case.

=> followed by a variable name. This holds an element per cycle of the loop.

=> followed by a column

=> followed by the array

=> followed by the closing parenthesis.

=> followed by a pair of curly parentheses serving as a block containing the  code to be executed in every cycle of the loop. In this case, the array elements, each held in turn by variable n, will be printed followed by a space.

A complete code and sample output for testing purposes are shown as follows:

==================================================

public class Tester{

    //The main method

    public static void main(String []args){

       

       String [] names = new String[5];

       nicknames(names);

    }

   

  //The nicknames method

    public static void nicknames(String [] names){

       names = new String[] {"John", "Doe", "Brian", "Loveth", "Chris"};

       for(String n: names){

           System.out.print(n + " ");

       }

       

    }

}

==================================================

<h2>Output:</h2>

John Doe Brian Loveth Chris

<em>NB: To run this program, copy the complete code, paste in an IDE or editor and save as Tester.java</em>

6 0
3 years ago
Other questions:
  • Can a computer evaluate an expression to something between true and false? Can you write an expression to deal with a "maybe" an
    13·2 answers
  • If the boolean expression a is true and b is false, the value of the logical expression a or b is ________.
    14·1 answer
  • I need help with Microsoft.
    6·1 answer
  • Jake is preparing his resume. He is applying for the position of iOS application developer at a large software company. He wants
    6·1 answer
  • Would a hurricane form if the humidity is really high and the breeze is very low
    11·1 answer
  • What messages do we get about ourselves from rap and hip hop
    7·1 answer
  • Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicatin
    6·1 answer
  • Who addicted to fnaf
    5·2 answers
  • 4. In computers, an integer can be represented by more than 8-bit, what is the largest positive integer that
    9·1 answer
  • Some elementary particles are positively or negatively
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!