Declare a vector named scores of twenty-five elements of type int .
  • vector streetAddress(80);
  • cout << monthSales[9];
  • x=arr[VECTOR_SIZE-2];
  • vector scores(25);
Given n vector a, declared to contain 34 elements , write an expression that refers to the last element of the vector.
  • a[n-1]=-1;
  • a[0]=3;
  • a[33]
  • a[0]
Assume v is a vector of integers that has been declared and initialized . Write a statement that adds the value 42 to the vector.
  • v.clear();
  • v.size()
  • v.capacity() - v.size();
  • v . push_back ( 42 ) ;
Assume that an array of integers named a that contains exactly five elements has been declared and initialized .Write a single statement that assigns a new value to the first element of the array . This new value should be equal to twice the value stored in the last element of the array .Do not modify any values in the array other than the first element .
  • a[0] = a[5 - 1] * 2;
  • cout << monthSales[9];
  • salarySteps[0]=30000;
  • x=arr[VECTOR_SIZE-2];
Assume v is a vector that has been declared and initialized . Write an expression whose value is the maximum number of values that could be stored in v.
  • v.clear();
  • v.size()
  • v.capacity() - v.size();
  • a[n-1]=-1;
Write a statement that declares a vector of char named streetAddress that contains exactly eighty elements .
  • cout << monthSales[9];
  • vector scores(25);
  • vector streetAddress(80);
  • x=arr[VECTOR_SIZE-2];
Given that an vector of int named a with 30 elements has been declared , assign 5 to its last element .
  • a[k+1]=9;
  • a[0]=3;
  • a[k-1]=22;
  • a[29]=5;
Assume v is a vector that has been declared and initialized . Write an expression that evaluates to true if there are any values stored in v.
  • a[n-1]=-1;
  • v.size()
  • v.clear();
  • v.capacity() - v.size();
Assume that a vector of int variables named salarySteps that contains exactly five elements has been declared . Write a single statement to assign the value 30000 to the first element of this vector.
  • salarySteps[4]=160000;
  • x=arr[VECTOR_SIZE-2];
  • a[0]+=10;
  • salarySteps[0]=30000;
Given the vector a, write an expression that refers to the first element of the vector.
  • a[29]=5;
  • a[0]
  • a[k+1]=9;
  • a[0]=3;
Assume v is a vector that has been declared and initialized . Write a statement that removes ALL the values stored in v.
  • v.clear();
  • v.capacity() - v.size();
  • v.size()
  • a[n-1]=-1;
Given that a vector of int named a has been declared , and that the integer variable n contains the number of elements of the vector a, assign -1 to the last element in a.
  • a[33]
  • a[n-1]=-1;
  • a[k+1]=9;
  • a[k-1]=22;
A vector of int named a that contains exactly five elements has already been declared and initialized . In addition, an int variable j has also been declared and initialized to a value somewhere between 0 andWrite a single statement that assigns a new value to the element of the vector indexed by j. This new value should be equal to twice the value stored in the next element of the vector (i.e. the element after the element indexed by j). Do not modify any other elements of the vector!
  • a[0] = a[5 - 1] * 2;
  • x=arr[VECTOR_SIZE-2];
  • a[j] = a[j+1] * 2;
  • cout << monthSales[9];
Assume that a vector named a, containing exactly five integers has been declared and initialized . Write a single statement that adds ten to the value stored in the first element of the vector.
  • a[k-1]=22;
  • a[k]=15;
  • a[0]+=10;
  • a[k+1]=9;
Assume that a vector of int named a has been declared with 12 elements and that the integer variable k holds a value between 0 and 6.Assign 15 to the vector element whose index is k.
  • a[k]=15;
  • a[k-1]=22;
  • a[k+1]=9;
  • a[0]+=10;
Given that an array of int named a has been declared with 12 elements and that the integer variable k holds a value between 2 andAssign 22 to the element just before a[k].
  • a[k+1]=9;
  • a[k]=15;
  • a[29]=5;
  • a[k-1]=22;
0:0:1



Answered

Not Answered

Not Visited
Correct : 0
Incorrect : 0