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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:30, Daud2020
What kind of motivation is katrina showing? use the drop-down menu to complete the statement. katrina is using motivation because she is personally interested in learning more.
Answers: 2
image
Computers and Technology, 24.06.2019 17:00, kappy10
Anew author is in the process of negotiating a contract for a new romance novel. the publisher is offering three options. in the first option, the author is paid $5,000 upon delivery of the final manuscript and $20,000 when the novel is published. in the second option, the author is paid 12.5% of the net price of the novel for each copy of the novel sold. in the third option, the author is paid 10% of the net price for the first 4,000 copies sold, and 14% of the net price for the copies sold over 4,000. the author has some idea about the number of copies that will be sold and would like to have an estimate of the royal- ties generated under each option. write a program that prompts the author to enter the net price of each copy of the novel and the estimated number of copies that will be sold. the program then outputs he royalties under each option and the best option the author could choose. (use appropriate named constants to store the special values such as royalty rates and fixed royalties.
Answers: 1
image
Computers and Technology, 26.06.2019 05:20, lizzidubois
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
image
Computers and Technology, 26.06.2019 07:00, alanflores40
The hatch command is found on which panel to the home tab to the autocab ribbon? a) modify b) draw c) layers d annotation
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 in other subjects:

Konu
English, 18.05.2021 18:20
Konu
Mathematics, 18.05.2021 18:20
Konu
Mathematics, 18.05.2021 18:20