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
Bezzdna [24]
3 years ago
6

Exercises: Solve the following problems on paper and bring your sheet of paper to your section on Thursday: Consider the followi

ng method: public static void arrayMystery(int[] array) { for (int i = 0; i < array.length - 1; i++) { if (array[i] < array[i + 1]) { array[i] = array[i + 1]; } } } Indicate what values would be stored in the array after the method arrayMystery executes if each integer array below is passed as a parameter to it. a. input = {2, 4} b. input = {1, 3, 6} c. input = {7, 2, 8, 4} d. input = {5, 2, 7, 2, 4} e. input = {2, 4, 6, 3, 7, 9}
Computers and Technology
1 answer:
Volgvan3 years ago
4 0

Answer:

Hi Lzvcorri! Based on the inputs, we can expect the answers:

a. [4, 4]

b. [3, 6, 6]

c. [7, 8, 8, 4]

d. [5, 7, 7, 4, 4]

e. [4, 6, 6, 7, 9, 9]

Explanation:

For a, the input is {2,4} so the array length is 2, and the loop will run for array.length - 1. So the first run with this array will see if array[i] (i=0 as initially set in the for loop with the statement "for (i=0;)") is less than the value in the array after it, array[i+1]. Since 2, is less than 4, it will assign the value of 4 in the first array index as per this condition being met (array[i] = array[i + 1];). Similarly, if you trace the execution of the program with the remaining inputs b, c, d, and e, you should expect the resultant array as in the answer above.

You might be interested in
please help me out i’ll give you brainlist
lyudmila [28]

Answer:

i thank its c

Explanation:

cause she wants to work on comunicatiton and team work

4 0
2 years ago
How dependent are we on technology? ​
rusak2 [61]

very independent  : ) we use it for everything

3 0
4 years ago
Read 2 more answers
Victoria is working on a computer that was infected with a virus when a client clicked on a link and downloaded a Trojan. Victor
tangare [24]

Answer:

The question is incomplete and should read as follows:

Victoria is working on a computer that was infected with a virus when a client clicked on a link and downloaded a Trojan. Victoria researched the virus and learned that the virus might have written itself into System Restore. What does Victoria need to do to run the antivirus software on System Restore?

This issue can be fixed by taking the following steps:

A. Disable System Protection.

B. Back up the restore point.

C. Enable System Protection.

D. Run the antivirus software on a restore point.

The system is then restored to the now clean restore point to rid the computer completely of the virus.

Explanation:

3 0
3 years ago
Read 2 more answers
Which process is based on repulsion of oil and water?
Tasya [4]
E.........................
4 0
3 years ago
Tina has made a database table in access containing field name class roll number and contact number she has set primary key for
Andrej [43]

Answer:

the answer is B for plato users

Explanation:

5 0
3 years ago
Other questions:
  • Regional culture has been affected by technology in these ways. Select all that apply. decreased educational opportunities impro
    9·2 answers
  • 1. If you are 15% years old, you are old enough to obtain
    10·2 answers
  • In ____________, a large address block could be divided into several contiguous groups and each group be assigned to smaller net
    7·1 answer
  • Which note taking strategy has you divide a page into 3 sections for your notes, key points, and summary?
    11·1 answer
  • after clicking the start button on your computer screen desktop what option would you then select to examine system components y
    15·1 answer
  • The four compass points can be abbreviated by single-letter strings as "N", "E", "S", and "W". Write a function turn_clockwise t
    15·1 answer
  • How many permutations for a 7 characters in length string, which contains all following letters R, X, S, Y, T, Z, U, has either
    7·1 answer
  • yo guys go sub to my channel road to i guess 20 or 30 my yt channel is called The Golden StreamerYT i have 16 subs we are almost
    10·2 answers
  • What is used for risk response control?
    7·1 answer
  • // This pseudocode segment is intended to compute the number
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!