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
Find the median and mean of the data set below: 29 17 40 12 29
quester [9]

answer:

median: 29

arrange the data in ascending order, and the median is the value in the middle. If there are an even number of values, the median would be the product of the two middle numbers. (12, 17, 29, 29, 40)

mean: 25.4

the mean of a set of numbers is the sum divided by the number of terms.

12 + 17 + 29 + 29 + 40 = 127 / 5 = 25.4

hope this helped!

6 0
3 years ago
The term used to describe an electronic device, operating under the control of instructions stored in its own memory, that can a
nlexa [21]
The answer to this is Computer!!
3 0
3 years ago
Categories of functions specified by computer instruction?
Lelu [443]
Is this for a test, because someone else asked that.
4 0
3 years ago
Categorize each of the following situations as a compile-time error, run-time error, or logical error. Group of answer choices m
svetlana [45]

Answer:

1. multiplying two numbers when you meant to add them - Logical Error

2. dividing by zero - Compile time error

3. semi colon at the end of a programming statement - Logical error

4. wrong in output - Run time error

5. when you should have typed a - Compile time error

6. producing inaccurate results - Logical error or Run time error

Explanation:

Compile time error is a lack in computer programming which causes to violate the rules which are defined by user in the program.

Run time error produces wrong outputs. It causes lags in the softwares which makes the output inefficient. It even causes programs crash when the output is just seconds away.

Logical error is the situation where programs completes the task assigned but with the wrong syntax. The output is produced with some abnormality.

3 0
3 years ago
Hi, I have several computer questions. These refer to the history of the internet. I would like to know if everything we look fo
MaRussiya [10]

<u>Hi dear user! </u>

<u>Hope my answer helps you and solve your queries. </u>

First of all,

ISP which is an acronym of Internet Service Provider, keeps the track of all the activities their users perform through their network.

For eg :-

You have a connection of Airtel, whatever you will access through your Airtel network will always be tracked by your ISP which is Airtel. If you delete your search/download history from your phone/laptop, still it can be seen by Airtel, you cannot delete from there end. Even if you access anything in incognito mode, then your browser does not stores your data but your ISP still can see what all you accessed in incognito mode.

Now coming to your next question,

If you delete your data from your phone or laptop, it is still somewhere saved in the hard drive of that device. The file is deleted from the device but it's hard drive still have that file, and anyone can access to that data by using a certain software but for that, the person will also need your hard drive. There are certain softwares like Disk Drill which is used to recover the hard drive's data.

Hope your queries are resolved !

7 0
4 years ago
Other questions:
  • Desktop, laptop, and tablet computers, and mobile devices are classified as _______.
    7·1 answer
  • Technology has changed the way functions are performed in the law office. Which function has been the least affected by technolo
    10·1 answer
  • Select the statements that are true regarding the future of technology. Select 2 options.
    10·2 answers
  • It proceeds the statement causes execution of the current loop iteration to end and commence at the beginning of the next loop.
    10·1 answer
  • The function below takes two parameters: a string parameter: CSV_string and an integer index. This string parameter will hold a
    14·1 answer
  • ________ uses the signals transmitted over the phone to access the database, retrieve account information and input data. Group
    11·1 answer
  • 1. Some of the music in the 1960s was used to protest social and political issues. Is music still used as a form of protest? Why
    13·1 answer
  • Is there any quantum computer in India?​
    9·1 answer
  • Hello. I have an app which doesn't let me get in. It says: "wrong app info". I'm in a samsung device. How can I solve that probl
    13·2 answers
  • wants to redesign the user interface. The customer service agents use ________ to enter explicit statement to invoke operations
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!