Decisions Flashcards

1
Q

Define an algorithm

A

A process or set of instructions to solve a problem by a computer

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

Explain how the If construct works

A

if (boolean expression)
{
carries out operation
}
else {
other
}

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

how can else if be used

A

To make a response for multiple ranges of values or expressions

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

Give an example of using a nested if construct

A

if an input is more than 10
if an input is less than 20
Display the value is between 10 and 20

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

When can switch statements be used

A

When there are multiple number of cases

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