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
NARA [144]
2 years ago
5

Help me with this pleaseeee, i'll give brainliest

Computers and Technology
1 answer:
iren [92.7K]2 years ago
6 0

Answer:

first question, to incremently increase

second is to generate a random number between the bounds of the min ,max

Explanation:

You might be interested in
Write the definition of the function inputArray that prompts the user to input 20 numbers and stores the numbers into alpha. Wri
Alina [70]

Answer:

In Java:

public static  int[] inputArray(){

   Scanner input = new Scanner(System.in);

   int[] alpha = new int[20];

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

       alpha[i] = input.nextInt();

   }

   return alpha;}

public static  int[] doubleArray(int [] alpha){

   int[] beta = new int[20];

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

       beta[i] = 2 * alpha[i];

   }

   return beta;

}

public static int[] copyAlphaBeta(int [] alpha, int [] beta){

   int [] AlphaBeta = new  int[10];

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

       AlphaBeta[i] = alpha[i];

   }

   int count = 5;

   for(int i = 15;i<20;i++){

       AlphaBeta[count] = beta[i];

       count++;

   }

   return AlphaBeta;

}

public static void printArray(int [] alpha){

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

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

       if((i+1)%15 == 0){

           System.out.println(" ");

       }

   }

}

Explanation:

The inputArray is defined here

public static  int[] inputArray(){

   Scanner input = new Scanner(System.in);

This declares alpha array of 20 elements

   int[] alpha = new int[20];

The following iteration gets input from the user into the array

<em>    for(int i = 0;i<20;i++){</em>

<em>        alpha[i] = input.nextInt();</em>

<em>    }</em>

This returns the alpha array

   return alpha;}

The doubleArray is defined here. It takes the alpha array as its input parameter

public static  int[] doubleArray(int [] alpha){

This declares beta of 20 integers

   int[] beta = new int[20];

This populates beta by 2 * alpha[i]

<em>    for(int i = 0;i<20;i++){</em>

<em>        beta[i] = 2 * alpha[i];</em>

<em>    }</em>

This returns the alpha array

   return beta;}

The copyAlphaBeta array is defines here

public static int[] copyAlphaBeta(int [] alpha, int [] beta){

This declares AlphaBeta as 10 elements

   int [] AlphaBeta = new  int[10];

This populates the first 5 elements of AlphaBeta with the first 5 of alpha

<em>    for(int i = 0;i<5;i++){</em>

<em>        AlphaBeta[i] = alpha[i];</em>

<em>    }</em>

   int count = 5;

This populates the last 5 elements of AlphaBeta with the last 5 of beta

<em>    for(int i = 15;i<20;i++){</em>

<em>        AlphaBeta[count] = beta[i];</em>

<em>        count++;</em>

<em>    }</em>

This returns the AlphaBeta array

   return AlphaBeta;

}

The printArray is defined here. It takes the alpha array as its input parameter

public static void printArray(int [] alpha){

This iterates through alpha array

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

This prints each element of the array

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

A new line is started after the 15th element

<em>        if((i+1)%15 == 0){</em>

<em>            System.out.println(" ");</em>

<em>        }</em>

   }

}

See attachment for complete program which includes the main

Download txt
4 0
2 years ago
Someone help meeeeeeeee plz.......................
xenn [34]

Answer:

B-2

      C-3

1/9

Explanation:

3 0
2 years ago
Read 2 more answers
Insert a row above the selected row
anastassius [24]
I cants see the "Selected Road" And I cant answer this unless you put that up. Sorry.
6 0
3 years ago
Read 2 more answers
Which of the following statements is not correct ​
just olya [345]
Wich statements ? I don’t see anything
4 0
2 years ago
Read 2 more answers
If you’re the victim of cyber bullying behavior, besides contacting your teacher or the school, where else can you go to find in
RideAnS [48]

parents

childline

ceop

family

3 0
3 years ago
Other questions:
  • Numbering exception conditions, which often uses hierarchical numbering, in a fully developed use case description is helpful to
    7·1 answer
  • Many software makers provide free downloadable updates, sometimes called a(n) ______ to users who have registered and/or activat
    5·1 answer
  • Technician A says that front and rear U-joints on a RWD axle should operate at different angles to prevent vibration. Technician
    10·1 answer
  • A large IPv4 datagram is fragmented into 4 fragments at router 1 to pass over a network with an MTU of 1500 bytes. Assume each f
    15·1 answer
  • To create a chart, you need to select at least
    8·1 answer
  • 41. All the following software are examples of operating systems EXCEPT
    5·1 answer
  • Binary numbers are based on __________.
    12·2 answers
  • Why should a user preview the document before printing?​
    15·2 answers
  • My brainly isnt working it isnt showing and answers wats going on? wat do i do
    14·2 answers
  • 3 uses of a computer ​
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!