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
LITERALLY PLS ANYONE!!! 90 pointsss!
Doss [256]

7. Intentional Virus Setting is when you the user purposely spread computer viruses in order to do harm. It should be noted that this is highly illegal (no duh) with a sentence of up to 10 years and $250,000 in penalties assuming you are convicted under the Computer Fraud and Abuse Act of 1986 here in the States.

8. intrusion of solitude, appropriation of name or likeness, public disclosure of private facts, and false light.

9.  Intentionally creating and/or sending a virus and infecting people's computers is against the law, and can result in jail time or a fine.

10. Some examples are: Deception - Lying about how information will be used. Violation of confidentiality - Disclosing someone's personal information without consent. Intrusion - Interference in an employee's personal life. Misappropriation - Using a person's likeness to promote a product without his consent.

11. Everyone wants PRIVACY for themselves, and everyone wants ACCOUNTABILITY from others. Privacy is a basic human need, and invasion of privacy can have serious psychological and emotional consequences, including paranoia, anxiety, depression and broken trust. Invasion of privacy is both a legal and an ethical issue.

12. A cause of action for invasion of privacy entitles the plaintiff to recover damages for the harm to the particular element of his or her privacy that is invaded. Thus, one who suffers an intrusion upon his or her solitude or seclusion, may recover damages for the deprivation of his or her seclusion.

13. An acceptable use policy (AUP) is a document stipulating constraints and practices that a user must agree to for access to a corporate network or the Internet. Many businesses and educational facilities require that employees or students sign an acceptable use policy before being granted a network ID.

14. Intellectual property refers to creations of the mind: inventions; literary and artistic works; and symbols, names and images used in commerce. Intellectual property is divided into two categories: Industrial Property includes patents for inventions, trademarks, industrial designs and geographical indications.

PLEASE PLEASE PLEASE HELP WITH MY RECENT!!!!!!

btw hope this helps if it does please make brainliest :)

6 0
3 years ago
Read 2 more answers
Write a program that gives simple math quizzes. The program should display two random numbers that are to be added, such as:
cestrela7 [59]

Answer:

6

Explanation:

8 0
3 years ago
Read 2 more answers
When the computer makes room for sentences on the next line, this is called
OLga [1]
That's easy its called enter you can push enter and it will bring you to the next line so that's it good bye have a nice day
3 0
3 years ago
Select the Stats Worksheet. Enter simple formulas in B3 and B4 to pull through the calculated Total Expenditure and Total Net fr
skad [1K]

Answer:

62.49

Explanation:

8 0
3 years ago
Create a Python program that asks the user in which direction to go? north, South East, or West?
QveST [7]

Answer:

huh

Explanation:

adsfghjkhgfdghjfghjkl

7 0
3 years ago
Other questions:
  • Why does hamlet want to kill himself and what stops him from doing that?
    10·1 answer
  • When evaluating portable CD players, you consider price, the sound quality, and ease of using the controls. These are your _____
    8·2 answers
  • What is the correct syntax to take the first five characters from the cell and place to its right in cell A3?
    15·1 answer
  • The QWERTY keyboard is the most common layout of keys on a keyboard. <br> a. True<br> b. False
    8·2 answers
  • You are building a gaming computer and you want to install a dedicated graphics card that has a fast GPU and 1GB of memory onboa
    6·1 answer
  • Which database item would show details such as a customer’s name, their last purchase, and other details about a customer?
    11·2 answers
  • The following program is run. Then the user clicks the "bottomButton" TWO TIMES. What will be displayed in the console?
    6·2 answers
  • 2. 5s is a Chinese principle adapted for use in the workplace.<br>True or False​
    11·1 answer
  • A student has completed some work at school and wishes to take it home. He could use a pen
    9·1 answer
  • HELP NEEDED PLEASE HELP!!! ​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!