subject

Consider the partially-filled array named a. what does the following loop do? (cin is a scanner object)

int[] a = {1, 3, 7, 0, 0, 0};
int size = 3, capacity = 6;

int value = cin. nextint();
while (size < capacity & & value > 0)
{
a[size] = value;
size++;

1. reads one value and places it in the remaining three unused spaces in a.
2. reads up to 3 values and places them in the array in the unused space.
3. reads up to 3 values and inserts them in the array in the correct position.
4. crashes at runtime because it tries to write beyond the array.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 25.06.2019 15:40
Provide the format and assembly language instruction for the following hex values: address 1000: 13 address 1001: 01 address 1002: 81 address 1003: fe
Answers: 2
question
Computers and Technology, 25.06.2019 20:30
Solve the following quadratic equation y=6x^2-12x+1
Answers: 1
question
Computers and Technology, 26.06.2019 05:20
In the csma/cd random access method, if the maximum propagation time is 100 micro seconds and the station has unsuccessfully attempted transmission ten times, the maximum amount of time the station waits before the next attempt to send is: a. 51,200 micro seconds b. 204,800 micro seconds c. 102,400 micro seconds d. none of the above
Answers: 1
question
Computers and Technology, 26.06.2019 13:30
To communicate an idea using a network, you might a. watch an online video. b. listen to a compact disc. c.write and send a text message d. read news on the internet
Answers: 1
You know the right answer?
Consider the partially-filled array named a. what does the following loop do? (cin is a scanner obj...
Questions
question
Mathematics, 04.11.2019 23:31