Computer Science
What are Conditionals?
What are Conditionals?
Conditionals are if/else statements in computer programming.
if/else statements are important blocks of computer programming
Example:
if (condition is met) {
<instructions1>
}
else { //else means condition is not met)
<instructions2>
}
Our program is guaranteed to always go down one of the two paths: either the condition is true and it goes down the first path, or it's false and it goes down the second path.
How are true/falses evaluated?
How are true/falses evaluated?
Computer programs use boolean expressions to determine whether something is true/false.
Boolean expressions return true or false.
For example,
(10 > 9) // returns true
(8 > 10) // returns false
Quiz!
Quiz!
Check your answers!
Check your answers!
Quiz Answers:
D
B
A, B, D
A, C, E
B