1/31
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
#include
are directives and interpreted by preprocessor before compiling
<iostream>
library that allwos standard I/O operations
using namespace std;
tells computer to use std namespace
//
indicates single line comment
int main() { }
special function called when program is run
cout «
character output device used to print values on console
return 0
returns integer to main
/* block comment */
multiple line comment
type VariableName
used to declare variables
bool
boolean
int
integer
char
character
float
floating point number
double
double precision floating point number
string
group of characters
const
used to not override existing variable values
&&
logical operator: and
||
logical operator: or
!
logical operator: not
++
arithmetic operator: increment adding one
—
arithmetic operator: increment subtracting one
cin »
used to get user input
getline(cin, myString)
used to include spaces in inputs
cin.sync()
used along with getline
if (condition) {
statements
}
used to specify code to be executed if condition is true
else {
statements
}
used to specify a code to be executed to be executed if condition is false
else if (condition) {
statement
}
used to specify new condition to test if first condition is false
switch (variable) {
case 1:
case 2:
case 3:
default
}
used to specify many alternative blocks of code only limited to one variable
while (condition)
{
(statements)
}
loop that tests condition and repeats statements while condition is true
do
{
(statements)
} while (condition)
loop that executes statements then evaluates condition
for (initialization; condition; increase)
{
(statements)
}
loop designed to iterate a specific number of times
x[max values] = {value 1, value 2, value 3}
used to store multiple values in a single variable