
C++ Vectors Review

Quiz
•
Computers
•
9th - 12th Grade
•
Easy
Ferhat Travaci
Used 12+ times
FREE Resource
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is true about vectors?
Vectors allow you to store multiple values in a single variable
Vectors can only hold one type of value
Vectors are dynamic and can grow in size
All of the other options are true
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is NOT a correct way to create a vector?
vector<string> greeting {"Hello", "Hola"};
vector<int> nums {3, 6, 7.8, 9};
vector<bool> option {true};
All of the options are correct
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be printed from the following code snippet?
vector<string> count {"One", "Two", "Three"};
cout << count.at(1) << endl;
cout << count[2] << endl;
1
2
One
Two
Two
Three
Three
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which statement best describes the actions of the push_back command?
push_back adds a new element to the front of the vector, pushing all of the elements back 1 index and increasing the overall size by 1.
push_back adds a new element to the end of the vector, increasing the size by 1.
push_back replaces the first element in the vector.
push_back replaces the last element in the vector.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code segment return?
vector<string> lang {"C++", "Java", "Python", "JavaScript"};
cout << lang.at(lang.size() - 2) << endl;
C++
Java
Python
JavaScript
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will print from the following code snippet?
vector<double> constants {3.14, 2.718, 0.577};
constants.pop_back();
constants.push_back(constants.size());
cout << constants[2] << endl;
2
3
2.718
0.577
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following code segments will print all members of an int vector v?
1 only
2 only
Neither 1 or 2
Both 1 and 2
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Exporting Files

Quiz
•
9th Grade
15 questions
JavaScript Basics

Quiz
•
12th Grade - University
15 questions
File Handling in C++ Programming

Quiz
•
12th Grade
12 questions
HTML and CSS

Quiz
•
9th - 10th Grade
20 questions
Endpoint Hardening

Quiz
•
12th Grade
21 questions
Web Design

Quiz
•
6th - 9th Grade
14 questions
Vector Images

Quiz
•
9th - 10th Grade
11 questions
Initialization Vector (IV) Attack

Quiz
•
11th Grade
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
30 questions
Computer Terminology Exercise #1 ( Fill Ins)

Quiz
•
9th Grade
15 questions
MLA Formatting

Quiz
•
9th Grade
20 questions
Typing Practice

Quiz
•
7th - 12th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
20 questions
Google Sheets Quiz

Quiz
•
9th Grade