What does cin stand for?
Console Input
What are three data types?
Name the five arithmetic (aka mathematic) operators.
Bonus 100 points (using the order of operations):
(15*2 + 16) / 0
The five mathematical operators are addition (+), subtraction (-), multiplication (*), division (/), and modulus (%).
In case you forgot, modulus takes the remainder after you divide it. (ex. 15 % 4 is 3)
What are the two things you can do to a variable?
You can retrieve the value (aka accessing the value), and you can also assign it a value (aka giving it a value).
What symbol punctuation ends almost all lines of C++ code?
What do you always need to input into?
You always need to input into a variable.
What data type can store words?
The data type string can store words (and more generally, characters)
What does the != boolean operator do?
The != boolean operator means 'not equal to', which is the opposite of ==, which means 'equal to'. ! also means not, which is a handy way to remember it too.
Tip: !(a == b) is the same as a != b
Yes, it is possible. Here's an example:
int a = 5, b = 7;
However, this would not work:
int a, b = 5, 7;
What type of programming is C++?
Computer Oriented Programming (COP)
Object Oriented Programming (OOP)
User Oriented Programming (UOP)
Programming Oriented Programming (POP)
The answer is Object Oriented Programming (OOP).
What are the two input and output keywords?
The two input and output keywords are cin and cout.
Why are floats called floats?
Float is short for floating-point integer, where the decimal is a 'floating' point inside an integer number. floats also take up about twice the memory of an integer.
What does the || operator do?
The || operator, aka or, returns true if any argument in the expression is true.
For example:
true || false is true
false || false is false
What are the three parts of a variable?
The three parts of the variable are the data type, the name, and the value.
What language was C++ based off of?
C++ was based on the language C. The name C++ comes from the ++ increment operator in C++ because C++ is one step above C..
What is the console?
It is the black box where you can interact with the program.
What two data types can a variable with data type bool store?
The boolean data type can have two values: true and false (lowercase).
What are compound assignment operators? (Hint: They change the value of a variable)
Bonus 100 pts: Can you name all of them?
Compound assignment operators are exactly what they sound like: compound assignment.
They compress an expression like a = a + b into something easier to read and write: a += b, which means you're adding b to a.
The compound assignment operators are: +=, -=, *=, /=, %=
If you initialize/declare a variable without assigning it a value, what will the value of the variable be?
The value would be whatever is in the memory slot that the variable uses. Sometimes computers don't clear the memory slots after you're done using a piece of data, so when you initialize a variable and it happens to use those few pieces of memory, it will get whatever was left behind. Different compilers would give different things.
What is the standard file extension for a C++ source code file?
.cs
.cpp
.c
.mp3
.png
.go
.MD
The correct answer is .cpp
What is the >> operator called? (hint: the other one is called the extraction operator)
The >> is called the insertion operator because it is used during input and inserts data from the console into the variable.
What is one way to initialize a variable with data type char and assign it a value to be '5'? Try to put it on one line.
Here are four possible ways to initialize the variable:
char my_char = '5';
char my_char = 53;
char my_char{'5'};
char my_char{53};
What boolean does this shorten to (extra time for this one :D)?
!((true || false) && false)
The answer would be true. Here is an expanded version with the steps:
!((true || false) && false)
!(true && false)
!(false)
true
Or, you could observe that (a && false) is always false, and take the opposite of that.
Which variable name below will work (as in it doesn't give an error when you use it)?
1234onetwothreefour
a_b_c_d_e_sing_along_with_me
16
o0o0o0o0o0o
this_one_doesnt_work
bool
The fifth variable name, this_one_doesnt_work, works.
However, if you add an apostrophe, like this: this_one_doesn't_work, it will not work.
What was C++ called before it was called C++?
C-Improved
The New C
C#
The correct answer is "The New C".