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; }
1. reads up to 3 values and places them in the array in the unused space.
2. reads one value and places it in the remaining first unused space endlessly.
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 01:30
Imagine that you have a friend who is starting a small business and is interested in using social media to spread the word. he is not certain that it is a good move, and has come to you for . would you advise him to use social media to advertise his business? why or why not? support you answer with information from the text.
Answers: 1
question
Computers and Technology, 22.06.2019 09:40
It is vital to research each of the services you plan to disable before implementing any change, especially on critical machines such as the: a. servers in the test environment. b. domain controller and other infrastructure servers. c. desktops that have previously been attacked. d. desktops used by upper-level management.
Answers: 2
question
Computers and Technology, 22.06.2019 13:00
Write a program which asks you to enter a name in the form of first middle initial last. so you might enter for example samuel p. clemens. use getline to read in the string because it contains spaces. also, apparently the shift key on your keyboard doesn’t work, because you enter it all lower case. pass the string to a function which uses .find to locate the letters which need to be upper case and use toupper to convert those characters to uppercase. the revised string should then be returned to main in the form last, first mi where it will be displayed.
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
State 7 common key's for every keyboard
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
History, 31.07.2020 22:01
question
Biology, 31.07.2020 22:01
question
Mathematics, 31.07.2020 22:01
question
Mathematics, 31.07.2020 22:01
Questions on the website: 13722362