Software-Engineering
# Why using Conditionals?
To make decisions based on different conditions.
Executed: from top ⇾ bottom
There are two ways an execution can be altered:
- conditional execution: statements are executed if a expression is true.
- repetive execution: statements are repetitively executed as long as expression is true.
# Implementation
# Examples
# If Statement
# If-else Statement
# If else-if else Statement
# Switch Statement
# Ternary operator
Here we replace
if(true) { … }
else …
Here the variable name is “Pedro”, when the age is greater than 10