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
Dennis_Churaev [7]
3 years ago
15

A piece of self-replicating code embedded within another program is called a

Computers and Technology
1 answer:
Lorico [155]3 years ago
8 0
I believe its a virus.
You might be interested in
how do you call the squares method to compute the first five squares and store the result in an array numbers
IRINA_888 [86]

Answer:

The method can be called using:

int[] returnarray = Squares();

<em>Where returnarray represents the name of the array</em>

Explanation:

To answer this, I will make an assumption that the Square method is an int array method (i.e. it returns array).

So, to call the method from main, an array has to be declared to get the values:

int[] returnarray = Squares();

Then an iteration is created to iterate through the array in order to print the array elements.

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

 System.out.print(returnarray[i]+ " ");    

-------------------------------------------------------------------------------------------

The answer ends here

-------------------------------------------------------------------------------------------

As an addition, the complete program that includes the method and the main is:

<em>public class Main{</em>

<em> public static int [] Squares(){</em>

<em>     int [] arr = new int[5]; </em>

<em>     for(int i = 1;i<6;i++){</em>

<em>         arr[i-1] = i*i;</em>

<em>     }</em>

<em>     return arr;</em>

<em> }</em>

<em> public static void main(String[] args) {</em>

<em>  int[] returnarray = Squares();</em>

<em>  for (int i = 0; i < returnarray.length; i++)</em>

<em>  System.out.print(returnarray[i]+ " ");          </em>

<em> }  </em>

<em>}</em>

8 0
3 years ago
Define a method named swapValues that takes an array of four integers as a parameter, swaps array elements at indices 0 and 1, a
Luba_88 [7]

The program is an illustration of arrays.

Arrays are used to hold multiple values.

The program in java, where comments are used to explain each line is as follows:

import java.util.*;

public class Main{

   //This defines the method

public static int[] swapValues(int[] arr) {

   //This swaps the first and second array elements

       int temp = arr[0];

       arr[0] = arr[1];   arr[1] = temp;

   //This swaps the third and fourth array elements

       temp = arr[2];

       arr[2] = arr[3];   arr[3] = temp;

   //This returns the swapped array to main

       return arr;

}

//The main method begins here

   public static void main(String[] args) {

       //This creates a Scanner object

       Scanner input = new Scanner(System.in);

 //This declares an array of 4 elements

 int[] intArray = new int[4];

 //This gets input for the array

 for(int i = 0; i<4;i++){

     intArray[i] = input.nextInt();

 }

 //This calls the swapValues method

 intArray=swapValues(intArray);

 //This prints the swapped array

 for (int i = 0; i < 4; i++){

 System.out.print( intArray[i]+ " ");     }

}  

}

At the end of the program, the elements are swapped and printed.

Read more about similar programs at:

brainly.com/question/14017034

6 0
3 years ago
Create 3 individual measures that calculate the 1, 3, and 5-year enrollment growth rates (percentages). a. The measures should b
Inessa [10]

IN THIS QUESTIONS MAKING PROGRAMMING

5 0
3 years ago
True or False. You can call/execute a function in the body of a loop
Sloan [31]

You can call/execute a function in the body of a loop is a true statement.

<h3>Can you call a function in a loop?</h3>

Yes, one can be able to call a function that is said to be inside from a loop as well. The function is known to be one that can be called each time the loop is said to have executes and it is one that will stop calling after the loop finishes.

<h3>When the loop body is executed it is called?</h3>

A single execution of the loop body is known to be what we call an iteration. The loop is one that can makes three iterations.

Hence, You can call/execute a function in the body of a loop is a true statement.

Learn more about loop from

brainly.com/question/26568485

#SPJ1

8 0
2 years ago
Why microcomputers are installed with TCP/IP protocols
Cerrena [4.2K]

Answer:

microcomputers are installed with TCP/IP protocols because its a set of standardized rule that allows the computer to communicate on a network such as the internet

Explanation:

4 0
3 years ago
Other questions:
  • What operator is used to create a validation rule? A. – B. / C. &lt; or &gt; D. +
    12·1 answer
  • Which OS function does a CLI fulfill? A User interface B Running applications C Hardware interface D Booting
    12·1 answer
  • What type of network does not have centralized control, such as one in a small office or home office?
    5·1 answer
  • Many web browsers, including internet explorer, edge, chrome, and safari, have a(n) ____ option to browse the web without leavin
    12·2 answers
  • Which of these statements about cell references is NOT true?
    10·2 answers
  • On the first line, place your name in a comment. Create a program that does the following: Take in three integer numbers from th
    5·1 answer
  • Helena purchased a security software package to protect her new laptop against threats such as spyware and computer viruses. she
    14·1 answer
  • Variablesallow us to manipulate data through the ___________.
    6·1 answer
  • IOS jail broken or Android unrooted which is better to hack with
    6·1 answer
  • Write a Python program string_functions.py that defines several functions. Each function re-implements Python's built-in string
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!