Basics
loops
Terms
output
Misc
100

Which data type could be used to store decimal numbers?

float or double

100

What is the primary difference between while and for loops?

A for loop is generally used when the number of iterations is known, 

A while loop is used when the number of iterations is not known.

100

A storage location identified by a name that can hold data and may be changed during program execution.

variable

100

What is the output of the following code?

int x = 3, y = 5;

if (x > y && x != y) {

    cout << "X";

} else if (x < y || x == y) {

    cout << "Y";  }

Y

100

What is the purpose of a loop in programming?

To repeat a block of code multiple times

200

How do you read user input in C++?

cin>>x;

200

What happens if an if statement's condition evaluates to false and there's no else statement?

The if block is skipped, and the program continues

200

The term for the operation of joining variables and strings together to form a single string.

Concatenation

200

What is the value of x after the following code executes?

int x = 5;

x += 10;

15

200

How do you exit out of a loop early in C++?

break; command

300

Which operator(s) is used for equality comparison?

==

300

What is the correct syntax for setting up a for loop?

for (i = 0; i < 5; i++)

Answer may vary - same setup

300

In C++, what is the purpose of using a continue; command inside a loop?

It skips the rest of the loop body for the current iteration.

300

int a = 5;

if (a < 10) {

    a += 5;

}

cout << a;

10

300

To generate a pseudo-random integer within a specified range you'd call in what function?

rand( )

400

How do you define a constant in C++?

const int X = 10;

400

What is a possible consequence of having a while loop with a condition that is always true?

Program will enter an infinite loop and eventually crash

400

What is an algorithm in the context of computer science?

A step-by-step procedure or set of rules to solve a problem or perform a task.

400

int i = 10;

while (i > 0) {

    cout << i << " ";

    i -= 2;

}

10 8 6 4 2

400

What is an example of a preprocessor directive in C++?

#include<iostream>

#include ....

500

What does the term "sequencing" refer to in programming?

The order in which statements are executed.

500

In a for loop, which part is executed only once, at the very beginning?

The initialization expression

500

An informal way to describe an algorithm using structured but plain language, making it easier to understand.

Pseudocode

500

What will the following code print?

int x = 3, y = 5;

if (x > y && x != y) {

    cout << "X";

} else if (x < y || x == y) {

    cout << "Y";

}

Y

500

The set of rules that defines the structure and format of valid statements in a programming language is called it's WHAT?

Syntax

M
e
n
u