This common operator is used with cin to read input from the user
>>
This function allows us to set a specific amount of empty spaces between outputs
setw()
This loop is also called a post-check loop
do-while
string toString(int num);
string toString(bool tf);
string toString(Color color);
Use a single cout statement that calls on all 3 overloaded functions at once
cout << toString(5) << toString(true) << toString(RED);
C++ commonly is associated with this programming methodology
object oriented programming (OOP)
Instead of cout we can use this output-based object to send information to the console and produce additional error diagnostics (IDE depending)
cerr
This string function returns the index of a character within a string
string.find()
an infinite loop can be purposefully made by adding what into a while loop expression?
true
Combine 2 characters into a single string.
string append(char a, char b);
string myString; myString += a;
myString += b; return myString;
{BONUS +200 - How can this be done with just a single line?}
This tool converts our C++ source code to assembly code
Compiler
{BONUS +200. What is the name of the tool to convert object code to an executable file?}
This header is used for file I/O
fstream
The functions for pow(), sqrt(), sin(), cos(), tan() are all apart of what header?
cmath
This keyword allows me to skip the current iteration of my loop and start the next iteration
continue
string veggies = "carrot, lettuce, green beans, turnips"
Create me a substring that returns "green beans"
veggies.substr(17,11);
This variable once initialized cannot be changed
Constant
This datatype cannot normally gather input via the standard C++ istream
enum/enumerator
My enumerated function -
Color getColor(string input);
Would require what as a return?
Color type
This for loop expression counts every odd number up to 20
for(int i = 1; i < 20; i+=2)
{BONUS +200, how would this expression change if I wanted every even number up to and including 20?}
If a negative number is passed in, convert it to positive. If a positive number is passed it, return that same number. Do this in a single line
int toPositive(int num);
return num > 0 ? num : num*-1;
This is another name for a fixed or hardcoded value stored within a variable
Literal
For how long does a standard file parse with >> last?
until EOF (end of file)
This function and its namespace found within the limits header helps us validate across datatypes with cin.ignore()
numeric_limits<type>::max()
This while loop expression validates whether or not a character is lowercase
while(!islower(char))
int num = 12345
move the last digit 5 to the beginning of the number. Your new number should be 51234. Keep the datatype as an int.
int num = 12345;
int lastDigit = num % 10;
int rest = num / 10;
cout << lastDigit * 10000 + rest;
{BONUS + 200, How can you do this using a more generic approach for any number given?}
Converting datatypes safely and explicitly requires a what?
static_cast