A loop that executes a block of code as long as a specific condition is true.
What is a while loop?
The number of the starting index of an array.
What is 0?
Data type that is imported from a library and stores text such as "Hello World".
What is string?
What is a function prototype?
The keyword used to take in user input from the console.
What is cin >>?
The statement that increments this for loop by one and represents the ? in the following code. Ex: for (int i = 0; i < 7; ?)
What is i++?
This structure is used to iterate through the elements of a one dimensional array.
What is a loop?
This is the size of the double data type in C++.
What is 8 bytes?
A predefined function, located in the cmath library, used to raise a number to a power.
What is pow?
A flow of control statement that is not an if statement and is used to execute the different blocks of statements based on the value of the given expression.
What is a switch statement?
Punctuation symbols that must be used to surround a loop when there are multiple lines of code.
What are curly braces ({})?
This structure is used to iterate through the elements of a two dimensional array.
What is a nested loop?
The output printed by the line of code cout << 7/2;
What is 3?
A character is used to indicate that a parameter in the function is call by reference, rather than call by value.
What is &(ampersand)?
A C++ library that must be included when reading or writing to a text file.
What is fstream?
The general time complexity of a single for loop that goes from 1 to a number n.
What is O(N)?
The amount of space an integer array of size 10 would take up.
What is 40 bytes?
The character that terminates a C-String.
What is \0?
A keyword used in a function to indicate it has no return value.
What is void?
A function from the iomanip library that controls the amount of decimal places.
What is setprecision()
int num = 4;
do {
cout << "Hello.\n";
num ++;
} while (num < 4);
while (num < 7){
cout << "Hello.\n";
num ++;
}
The amount of times Hello will be printed in the above code.
What is 3?
This line of code creates an two-dimensional integer array called board with 3 rows and 4 columns.
What is int board[3][4];?
int a = 5, b = 10;
int temp;
Given the above code, these are three lines of code that swap the values of a and b.
What is temp = a; a = b; b = temp;?
int main () {
int a = 100, b = 200;
mySwap(a,b);
return 0;
}
void mySwap(int x, int &y) {
int temp = x;
x = y;
y = temp;
}
The value of a and b after the above lines of code.
What is 100?
ifstream inputFile("input.txt");
if (!inputFile) {
cerr << "Error opening the file." << endl;
return 1;
}
int number;
while (?) {
inputFile >> number;
}
The condition represented by the ? in the above code that allows the user to read until the end of the file.
What is !inputFile.eof()?