Decision Structure Flashcards
(6 cards)
1
Q
What is a if statement?
A
A construct that enables a program to specify alternative paths of execution
2
Q
What are a few of the type of selection statements C# has?
A
one-way if statements, two-way if-else statements, nested if statements, multi-way if-else statement, switch statements conditional operators
3
Q
What is a one way if statement?
A
Executes an action if the specified condition is true. If the condition is false, nothing is done.
4
Q
What is the syntax for a one way if statement?
A
if (boolean_expression) { // statement(s) }
5
Q
What is a two way if-else statement?
A
Decides the execution path based on whether the condition is true or false
6
Q
What is the syntax for a if-else statement?
A
if (boolean-expression) { // statement(s)-for-true-case } else { // statement(s)-for-false-case }