What does cin stand for?
Console Input
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)
No
What data type is double similar to?
float
What language is C++ based off of?
C++ is based off of C.
What data type can store words?
The data type string can store words (and more generally, characters)
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};
True or false: If statements cannot be put inside each other.
Why not?
How do you insert comments in C++?
/* This is not a comment
// This is also not a comment
# This is a comment
// This is also not a comment
What is the C++ file extension (Triple points for this one)? Hint: Use the process of elimination
.txt
.mp4
.h
.wav
.zip
.java
.ppt
.h
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 two data types can a variable with data type bool store?
The boolean data type can have two values: true and false (lowercase).
True or false: If is an example of controlling the flow of the program.
Yes!
P.S. Oops didn't answer the question. "True".
Which of the following is a valid C++ variable name?
54321
one2three4
:<}:"|>|
namespace
one2three4
Which of the following is a string constant?
'G'
"pen-pineapple-apple-pie"
15.234
1235123412341243123414314312341341234123412341234134123412341234134123413412341324134123
"pen-pineapple-apple-pie"
What are three data types?
The data types are long, short, void, bool, string, char, int, float, double, and auto. (you can have any three)
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: +=, -=, *=, /=, %=
What will the program output if this if-condition is run and the value of a is 15?
if(!(a>25)){
cout << "endl" << endl;
} else {
cout << "cout" << endl;
}
endl
Which statement executes one set of statements when true and another when false?
The if statement
The if/else statement
The if/else if statement
The switch statement
The if/else statement
Who was the inventor of C++ (Use the process of elimination!)
Babe Ruth
Bjarne Stroustrup
Albert Einstein
Tom Cruise
Bjarne Stroustrup
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 boolean does this shorten to (extra time for this one :D)?
!((true && false) || false)
True
True or false: This program outputs hello if the name of the person is Joe.
if (name = "Joe"){
cout << "hello";
}
False, it will produce an error
Which loop tests a condition after its iteration but before incrementation?
The while loop
The for loop
The do-while loop
The do-for loop
There is no such loop, what are you talking about?
The do-while loop
What type of programming language is C++?
Objected Oriented Programming (OOP)
User Oriented Programming (UOP)
Player Oriented Programming (POP)
Speed Oriented Programming (SOP)
Objected Oriented Programming (OOP)