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
True or false?
AnnZ [28]

Answer:

True

Explanation:

Media coding is the procedure of defining the Media codes, written symbolic and technical tools that are applied to construct or come up with the meaning in various media products or forms. It includes the proper use of the camera, setting, acting, editing, special effects, sound, color, text, visual composition, graphics, typography, and mise en scene. Hence, the fact mentioned in the question is true.

7 0
3 years ago
You have a chart that shows 100 data points and you've circled the highest value. Which of the following are you using?
cricket20 [7]

The Rudolph Rule states that  simple ways you can make information stand out and guide or satisfy your audience to important details and highlight important  information in your presentation

so i conclude option D is correct for above statement

hope it helps

5 0
3 years ago
Read 2 more answers
What is input process<br>​
riadik2000 [5.3K]

Answer:

describing the structure of an information processing program or another process. Many introductory programming and systems analysis texts introduce this as the most basic structure for describing a process.

Explanation:

  • A requirement from the environment (input)
  • A computation based on the requirement (process)
  • A provision for the environment (output)

Example: A small engineering firm believes there are problems with its hiring process. Several of the junior engineers that have been hired remained at the firm for less than one year. This is a considerable cost to the firm, since recruiting and training new engineers is time consuming and expensive. The human resources manager decides to put together a group of people with extensive experience hiring new engineers. One of their first tasks is to produce an input-output model of the hiring process. They generate the following.

4 0
3 years ago
What statement would you use to print the phrase Hello, world and then start a new line?
tangare [24]

Answer:

Statement to print phrase "Hello, world" and then start a new line in java.

System.out.println("Hello, world");

Explanation:

In java, we use "System.out.println();" statement to print any string/phrase and then start a new line.The above line will print phrase "Hello, world" and then start a new line.

Implementation in java:

// class definition

class Main

{

// main method of the class

public static void main (String[] args)

{

// statement to print phrase and start new line

      System.out.println("Hello, world");  

} }

7 0
3 years ago
Rebecca is creating a method for her class, but wants to make sure that a variable in the method satisfies a conditional phrase.
astraxan [27]

Answer:

D. an assertion

From PLATO

6 0
2 years ago
Other questions:
  • Explaim Why the shape of a cell is hexagonal
    15·1 answer
  • President Roosevelt's Fireside Chats were:
    12·2 answers
  • Hypertext Markup language (HTML) version _____ added support for style sheets to give web designers greater control over page la
    12·1 answer
  • Study the sentences below. A.Changing the properties of characters in a sentence or paragraph in a Word document helps increase
    5·2 answers
  • This unit is used to print the picture on a paper
    6·1 answer
  • Which components are involved with input? Output? Processing? Storage?
    15·2 answers
  • Simplest way to start baking career is to attend_______.<br><br><br><br>​
    9·1 answer
  • when demonstrating 2022 altima’s parking assistance, what steering feature should you mention when pointing out how easy the veh
    10·1 answer
  • What does a theme contain?
    14·2 answers
  • When constructing policies regarding data _______________, it is important that these policies offer particular guidance on sepa
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!