1/11
Vocabulary flashcards covering key terms from the lecture on conditional statements and the I would rather values.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Integrity
Choosing honesty and accountability; telling the truth even when you have made a mistake rather than making excuses.
Perseverance
Continued effort to solve a difficult problem and not give up; keep trying until you succeed.
Synergy
Working with others to complete a project, achieving a result greater than working alone.
Adaptability
Ability to adjust to new rules or schedules in school; flexibility to change when needed.
Conditional statements
Programming constructs that decide which part of code to execute based on whether a condition is true or false.
If statement
Executes the block of code when its condition evaluates to true.
Else statement
Executes the block of code when the condition evaluates to false.
Else-if statement
Tests a new condition if the previous condition is false; used to chain multiple conditions.
Brace usage
Use curly braces {} to enclose code blocks after conditional statements to avoid errors.
Assignment vs equality operator
Using = (assignment) instead of == (equality) in a condition can cause logic errors.
Missing parentheses around condition
In C++, the condition in an if statement must be inside parentheses; omitting them causes syntax errors.
Extra semicolon after if or else
A semicolon after the if/else is a no-op, causing the conditional to do nothing.