Selection- JT Flashcards
How does a ‘condition’ statement work?
To specify that certain lines of code should be executed only if a condition is met.
For example, in a login system, you might want an error message to be displayed only if the user enters an invalid password. If the password is correct, an alternative block of code can be run to allow entry to the system.
What is ‘selection’ programming?
Selection is a programming construct that allows a program to run sequences of code depending on whether a condition evaluates to True or False.
What are examples of ‘selection’ statements?
If, If Else, Else If
What is ‘Nested Selection’?
Nested selection is used to help implement branching logic under on specific condition creating sub-conditions.