Lecture 5 Flashcards
While loop
Loop that repeats while the conditional is met.
Do while loop
The do statement proceeds the command and the while and conditional appear at the end of the command. This executes the commands once before checking the conditional.
Sentinel
A special value that tells the loop to end
Casting a value
Changing a variable to another type can be formated in two ways:
(type)variable
Type(variable)
For loop
Conditional contains intilization, conditional, and update/iteration separated by a semicolon.
Variable scope
Place where the variable exists. Only exists within the curly braces it was declared in.
Static variable
Goes before the variable type. Makes the variable last through all iterations of a loop but not after the loop breaks.