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, 22.06.2019 17:00
What allows you to create a wireless connection among your smart devices
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
Rafael needs to add a title row to a table that he has inserted in word. what should he do? use the alignment options. use the merge and center option for all the cells in the top row. use the merge and center option on the first two cells in the top row. none of the above
Answers: 3
question
Computers and Technology, 24.06.2019 17:40
Anewly established internet company with 40 employees needs your advice. they are looking for a collaboration tool and have narrowed their choices to gotomeeting, webex, and my web conferences. after reading the information presented in this chapter and other sources, prepare a two- page document ( double spaced) that includes two advantages and two disadvantages of each tool. which one is your final recommendation? why did you choose that tool over the other two?
Answers: 3
question
Computers and Technology, 24.06.2019 22:00
What is a number system, and what is the total number of digits used in this system called? a number system is a system that uses different (options: a) numbers b) symbols c) codes d) digits e) alphabets) to represent different numbers. the total number of digits used in a number system is known as its (options: 1) processor 2) converter 3) radix 4) least significant digit 5) most significant digit)
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, 07.03.2021 22:40
question
Mathematics, 07.03.2021 22:40
question
Mathematics, 07.03.2021 22:40
question
Computers and Technology, 07.03.2021 22:40
Questions on the website: 13722362