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
charle [14.2K]
3 years ago
12

A function defined beginning with void SetNegativesToZeros(int userValues[], ... should modify userValues such that any negative

integers are replaced by zeros. The function _____.
Computers and Technology
1 answer:
Stels [109]3 years ago
3 0

Answer:

   public static void setNegativesToZero(int userValues[]){

       System.out.println("Array before setting negatives to zero "+Arrays.toString(userValues));

       for(int i=0; i<userValues.length; i++){

           if(userValues[i]< 1){

               userValues[i] = 0;

           }

       }

       System.out.println();

       System.out.println("Array After setting negatives to zero "+Arrays.toString(userValues));

   }

Explanation:

Using Java programming Language, the method is created to receive an array of ints as parameter (as specified in the question)

Using a for loop, we iterate over the entire array checking for values that are negative (<0) and setting them to zero.

See a complete program below

import java.util.Arrays;

import java.util.Scanner;

public class num1 {

   public static void main(String[] args) {

   // Create an array and assign values

       int [] arr = {1,2,3,-1,1,2,-4};

   //Calling the method setNegativesToZero

   setNegativesToZero(arr);

   }

//Creating the Method

   public static void setNegativesToZero(int userValues[]){

       System.out.println("Array before setting negatives to zero "+Arrays.toString(userValues));

       for(int i=0; i<userValues.length; i++){

           if(userValues[i]< 1){

               userValues[i] = 0;

           }

       }

       System.out.println();

       System.out.println("Array After setting negatives to zero "+Arrays.toString(userValues));

   }

}

You might be interested in
To verify a Windows system meets the minimum processor and memory requirements to install software, use the ________.
Bas_tet [7]

To verify a Windows system meets the minimum processor requirements

to install software, use the system control panel window.

<h3>What is System control panel window?</h3>

This is the window which is found in all computers and comprises of the

following:

  • Device information such as Hardware and Software.
  • User accounts
  • Accessibility options
  • Networking settings.

Checking this window will help to check if the windows system meets the

necessary requirements.

Read more about System control here brainly.com/question/14878948

8 0
2 years ago
We can include following item(s) during configuration itemidentification:
Ainat [17]

Answer:

d) All of the above

Explanation:

In configuration management, the Identify configuration items, work products and related components are present.

  • All the documents which are related to the work,the manuals how that the system works are present in the configuration item identification.
  • The source code that is implement for the functioning of the products.These are implemented at the time of generation of products.
  • Software Requirement Specifications are also specified by SRS it is present in design stage of software development life cycle,it is also a part of configuration item identification.
5 0
3 years ago
Write a method called min that takes three integers as parameters and returns the smallest of the three values, such that a call
Debora [2.8K]

Answer:

public class Main

{

public static void main(String[] args) {

 System.out.println(min(3, -2, 7));

}

public static int min(int n1, int n2, int n3){

    int smallest = Math.min(Math.min(n1, n2), n3);

    return smallest;

}

}

Explanation:

*The code is in Java.

Create a method named min that takes three parameters, n1, n2, and n3

Inside the method:

Call the method Math.min() to find the smallest among n1 and n2. Then, pass the result of this method to Math.min() again with n3 to find the min among three of them and return it. Note that Math.min() returns the smallest number among two parameters.

In the main:

Call the method with parameters given in the example and print the result

7 0
2 years ago
What might be some challenges if you’re trying to design a product for someone
ValentinkaMS [17]

Answer:

failure

Explanation:

if someone dosnt like it

4 0
3 years ago
Read 2 more answers
A client has macular degeneration resulting in moderate visual impairment. The client works as a data entry clerk and wants to c
weqwewe [10]

Answer:

Low Vision Aid for Computer Users

Explanation:

Visually impaired people can use the same low vision aids for viewing a computer screen as they do for regular reading activities. These include eyeglass-mounted magnifiers, handheld magnifiers and stand-alone magnifiers.  But also, special software has been developed to display content on the screens of computers and other digital devices in large print. Other applications can read text and other visual content aloud with a synthetic voice.  These adaptive low vision devices let partially sighted people do the same computer-related tasks as fully sighted people — such as word processing, creating and using spreadsheets and viewing web pages online.

4 0
3 years ago
Other questions:
  • Var cookie = "username=mike2009";
    10·1 answer
  • If johanna wants to label the x- and y-axes, she should click Layout, then
    8·1 answer
  • It is illegal to have __________ emergency lights on your vehicle.
    6·2 answers
  • The use of electronic media, information, and communication technologies to deliver instruction where students are not required
    8·1 answer
  • This method of advertising is expensive but can be the most effective method.
    15·1 answer
  • Consider the following short paragraph: On a computer with a single core CPU, attempting to program real concurrency between two
    6·1 answer
  • Which question about whale sharks is nonscientific?
    11·2 answers
  • Apex
    5·2 answers
  • Select the correct answers
    9·1 answer
  • Professional communication must be objective,
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!