1/16
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
Expression
A sequence of operators that reduce or result in a single value
Pre-increment (++x)
Increments the variable x first then evaluates its updated value in the surrounding expression
Post-increment (x++)
Evaluates the current value of x in the expression first the increments
Increment operator
++1
Decrement operator
—1
Selection/branching
The process of directing program execution down different statement paths based on Boolean condition evaluates to true (any none 0 value) or false (0)
Selection
The decision making mechanism. Uses Boolean evaluation (0=false, non-zero=true) to test values
Branching
The code path executed as a result of the decision
Break
A control statement used inside a switch block to immediately exit the construct and prevent “fall-through” execution into subsequent cases
Default
The optional fallback label within a switch statement that executes when none of the explicit case values match the expression
Mathematical hierarchy
(), unary operations(square root/absolute value/ect), */%, +-
Modulo operator
% returns the remainder
Does not use float point integers: reads syntax/completion error
Divide by 0
Runtime error
Division returns the quotient
Boolean condition
Operator used to evaluate is an expression is true (any non-zero number) or false (0)
Multi-way switch statement
Switch(a) {
Case 0:
(…)
Break;
Case 1:
(…)
Break;
Default:
(…)
Break;
}
Used for discrete variables (a finite set)
Multi-way if statement
If(choice == 1) {
(…) }
Else if(choice == 2) {
(…) }
Else {
(…) }
Value ranges
Epsilon
Float-point numbers are equal
==