Name_______________________
Login___________________SID________
CS 010: Introduction to
Computer Science I
Use the following declaration statement for the next 4 questions.
vector<double> v(100);
a. 0
b. 1
c. 99
d.
100
e. 101
f. none of the above
a. 0
b. 1
c.
99
d. 100
e. 101
f. none of the above
a.
0
b. 1
c. 99
d. 100
e. 101
f. none of the above
a. cout << v;
b. for (int i = 0; i < 100; i++) cout << v[i] << “ “;
c. for (int i = 1; i <= 100; i++) cout << v[i] << “ “;
d. for (int i = 0; i < v.size(); i++) cout << v[i] << “ “;
e. for (int i = 1; i <= v.size(); i++) cout << v[i] << “ “;
f.
B
and D
vector<string> s;
Use the following code fragment for the next 3 questions
(I recommend writing out the vector’s contents)
vector<int> v(2); v[0] = 10; v[1] = 20; for (int i = 1; i < 3; i++) {
v.push_back(i); }
v.pop_back();
vector<Point> points(10);
points[100] = cwin.get_mouse(“Click anywhere”);
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
cout << “*”;
}
}