Decisions Flashcards
1
Q
Define an algorithm
A
A process or set of instructions to solve a problem by a computer
2
Q
Explain how the If construct works
A
if (boolean expression)
{
carries out operation
}
else {
other
}
3
Q
how can else if be used
A
To make a response for multiple ranges of values or expressions
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
5
Q
When can switch statements be used
A
When there are multiple number of cases