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, 23.06.2019 06:30
Who can provide you with a new password when you have forgotten your old one? your provide you with a new password in case you forget your old one.
Answers: 3
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
Think of a spreadsheet as a giant calculator spread of paper chart data collector
Answers: 2
question
Computers and Technology, 25.06.2019 06:50
Write a program that will askthe user to enter the amount of a purchase. the program should thencompute the state and county sales tax. assume the state sales tax is4 percent and the county sales tax is 2 percent. the program should displaythe amount of the purchase, the state tax, the county sales tax, the total salestax, and the total of the sale. (which is the sum of theamount of purchase plus the total sales tax). hint: use the value 0.02 torepresent 2 percent, and 0.04 to represent 4 percent.
Answers: 2
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
Computers and Technology, 27.09.2019 10:10
question
Mathematics, 27.09.2019 10:10
question
Mathematics, 27.09.2019 10:10
question
Mathematics, 27.09.2019 10:10
Questions on the website: 13722360