Question #1: The ____________ class is a container class for holding a(n) ____________ of values.
Question #2: The ____________ defines many container classes and algorithms for those classes.
Question #3: A(n) ____________ class allows us to declare containers over a particular data type.
Question #4: The container algorithms access a container through ____________, not the container itself.
Question #5: A(n) ____________ is a number used to access a particular element from a container.
Code #1:
Write a declaration for a vector
of int
s named
values
.
Code #2:
Write an expression that evaluates to the length of values
.
Code #3:
Write an expression that evaluates to the first element of
values
(assume that values
has at least one element
in it).
Code #4:
Write an expression that evaluates to the last element of the
values
(assume that values
has more than one element
in it).
Code #5:
Write an expression that calls accumulate
that adds together
the values in values
, initializing the sum to -32.