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
solmaris [256]
3 years ago
12

Create a static method called fillArray, which takes an integer array as an input parameter, along with an integer initial value

. It should then fill the array with values starting from the initial value, and counting up by 1s. For example, if the data array has length 5, and if the initialValue is 3, then after execution the array should hold this sequence: 3 4 5 6 7. public static void fillArray (int[] data, int initialValue) {
Computers and Technology
1 answer:
JulijaS [17]3 years ago
3 0

Answer:

public class print{

   

   public static void fillArray(int[] arr, int initialValue){

       

       int n = arr.length;

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

          arr[i] = initialValue++;

      }

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

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

      }

       

   }

    public static void main(String []args){

       

        int[] array = new int[5];

        int initialValue =3;

       

        fillArray(array,initialValue);

       

    }

}

Explanation:

Create the function with two parameter first is array and second is integer.

Then, declare the variable and store the size of array.

Take the for and fill the array from the incremented value of initialValue  by 1 at every run of loop.

After loop, print the element of the array.

Create the main function which is used for calling the function and also declare the array with size 5 and initialValue with 3. After that, call the function with this argument.

You might be interested in
Which statement about synchronous communication is true?
tangare [24]
In general, synchronous communication means you have to wait for the answer all the time. The programming logic is simpler, but the cost that you spend a lot of time waiting.

If the options are:

<span>a. The people communicating don't need to be online at the same time.
b. There is lag time in the communication.
c. The communication occurs in real time.

a is false, you do need to be online to receive the message
b is true, typically you continue only after an acknowledgement
c is true, you wait for acknowledgement that occurs in real time (not necessarily fast though)</span>
3 0
3 years ago
Younger people haven’t established brand loyalty the way older people have
krek1111 [17]
What’s your question?
6 0
3 years ago
Jim wants to buy a car, he’ll probably only need it for a couple of years he has a short commute to work so he won’t put many mi
Papessa [141]
Is there more information? or options?
4 0
3 years ago
Anna discovers malware on her computer. After being downloaded, the malware self-activated and replicated itself and infected th
Tresset [83]

Answer:

A.

Explanation:

The malware that replicates itself and can infect the entire system is a worm.

A worm is a type of malware that gets self-activated and replicated. This worm spreads rapidly over the computer system and can corrupt all the files and the entire system.

A worm is a standalone application and does not require action from humans.

Therefore, option A is correct.

6 0
3 years ago
Jonathan wants to create an online journal. He will use it to share with his friends all the cool places he visits while in Euro
nirvana33 [79]

Answer:

a blog

Explanation:

a forum is for questions, a wiki doesn't make sense in this situation and email wouldn't be used for this either so it should be a blog

7 0
3 years ago
Read 2 more answers
Other questions:
  • 1. Which markup language adds the ability to use video without requiring the user to download add-ons?
    13·1 answer
  • Sue conducted an experiment to determine which paper towel is the most absorbent among three different brands. She decides to pr
    15·1 answer
  • Research the disadvantages of the computer and explain them.​
    15·1 answer
  • A network system administrator would typically be responsible for which of the following duties?
    7·2 answers
  • ____________ is a widely accepted international best practices framework for implementing information systems security.
    12·1 answer
  • When someone registers a domain name that is a company's trademark, hoping to resell it to the company at an exorbitant profit,
    14·2 answers
  • The statement ____ declares intList to be a vector and the component type to be int
    8·1 answer
  • Above all, you want to implement the cheapest CRM system available. You are willing to accept any risks associated with this, so
    11·1 answer
  • Which process centers the spreadsheet's content on the page?
    15·1 answer
  • Sebutkan contoh komputer analog, komputer digital, dan komputer hybrid
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!