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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

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

What is the syntax for a one way if statement?

A
if (boolean_expression)
{
     // statement(s)
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a two way if-else statement?

A

Decides the execution path based on whether the condition is true or false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly