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
vodka [1.7K]
4 years ago
10

What does a contain after the following code runs?int[] a = {1, 3, 7, 0, 0, 0};int size = 3, capacity = 6, value = 5;int pos = 0

;for (pos = 0; pos < size; pos++)if (a[pos] < value) break;for (int j = size; j > pos; j--)a[j] = a[j - 1];a[pos] = value;size++;
Computers and Technology
1 answer:
Lady bird [3.3K]4 years ago
3 0

Answer:

a={5,1, 3,7, 0, 0}

Explanation:

when the code runs,

a={1, 3, 7, 0, 0, 0} , size=3, capacity=6 ,value=5,pos=0.

When loop starts pos is zero for pos 0,1 if conditon is true and loop breaks and moves to next loop.

On first iteration pos is 0 and j is 3. it moves element at 3rd index to 2.

On second iteration pos is 0 and j is 2. it moves element at 2nd index to 1.

On third iteration pos is 0 and j is 1. it moves element at 1st index to 0.

On fourth iteration pos is 0 and j is 0.Hence the condition for loop is false and the code inside does not run. This behavior  is followed until loop completes all iterations

As pos is not changing after each iteration 0th index is 5.

You might be interested in
A(n) _____ is a computer network that uses Internet Protocol technology to share information, operational systems, or computing
belka [17]

Answer:

The answer is A - INTRANET.

Explanation:

Option B is not the correct answer. An intercom is a stand-alone voice communications system for use within a building or small collection of buildings, functioning independently of the public telephone network. Intercoms are generally mounted permanently in buildings and vehicles

Option C is not the correct answer. In telecommunication, a transponder is a device that, upon receiving a signal, emits a different signal in response.

Option A is the correct answer. An intranet is a computer network for sharing corporate information, collaboration tools, operational systems, and other computing services only within an organization.

3 0
3 years ago
A _______ attack is where the input includes code that is then executed by the attacked system.
sweet [91]

Answer: Code injection

Explanation:

3 0
2 years ago
A gui allows you to interact with objects on the screen such as icons and buttons true or false
Alja [10]

Answer:

True

Explanation:

7 0
3 years ago
What is the complete predicate in the sentence below? Looking up from his computer monitor, Jason mopped his brow, exhaled sharp
frozen [14]

Answer:

A. mopped his brow, exhaled sharply, and picked up his phone.

Explanation:

Predicate in a sentence talks about the actions relating to the subject of the sentence, Here, The complete predicate is option A.mopped his brow, exhaled sharply, and picked up his phone. because they were the actions performed by the subject (John) the subject in a sentence usually refers to the person, place, thing, etc (Noun).

3 0
3 years ago
Match each operating system drawback to its respective operating system.
Lena [83]

Answer:

Microsoft Windows - More susceptible to viruses

Linux - Limited support system

Apple - Fewer compatible applications

Explanation:

Generally windows is more susceptible to viruses.

Linux is open source meaning it's up to the community to help you.

Apple has been supporting more applications in these coming years but it still lacks the wide range of apps windows supports.

4 0
3 years ago
Read 2 more answers
Other questions:
  • In tableData the column variable of the first column should be RowerNames, the second RowingEvent, the third RowerWeight and the
    6·1 answer
  • You csn access various sites on the www by using hyperlinks or by
    7·1 answer
  • Diane is receiving a lot of unwanted e-mail. What steps can she take to reduce the amount of e-mail she receives?
    12·1 answer
  • What is the output of the following code? stackList stack; int x, y; x = 2; y = 3; stack.push(8); stack.push(x); stack.push(x +
    6·1 answer
  • 3.2 lesson practice edhesive ​
    6·1 answer
  • Show the output waveform of an AND gate with the inputs A, B,
    5·1 answer
  • If someone wanted to talk to a financial institution representative in person they would need to _____.
    5·1 answer
  • Which items in the list below are viruses. Click in the box to select your answer(s).
    8·1 answer
  • 9. How much is gaming and video game streaming predicted to grow from 2018-2026?
    14·1 answer
  • Why hand tools are important in repairing personal computer?​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!