Selection- JT Flashcards

1
Q

How does a ‘condition’ statement work?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is ‘selection’ programming?

A

Selection is a programming construct that allows a program to run sequences of code depending on whether a condition evaluates to True or False.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are examples of ‘selection’ statements?

A

If, If Else, Else If

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is ‘Nested Selection’?

A

Nested selection is used to help implement branching logic under on specific condition creating sub-conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly