Single-alternative selections, take action on just one branch of the decision. The single-alternative selection structure evaluates a condition and executes a block of code if that condition is true. If the condition is false, then the block of code is ignored. An example of a single-alternative selection structure is the if-then statement. if (average_score < 60) cout < < "Failing" < < endl;
Dual-alternative is defined as one action to be taken when the tested condition is true and another action to be taken when it is false. The dual-alternative selection structure evaluates a condition and executes one of two possible passage ways paths. If the condition is true, then one block of code is executed. If the condition is false, the other block of code is executed. An example of a dual-alternative selection structure is the if-then-else statement.
If (average_score < 60) dispay Failing else score
+++++++++++++++++++
>>60 print "Passing" endl;
To make a decision based on the value of a variable we have used the if-then-else statements. If there are multiple values the variable can take on, we have used multiple or nested if-then-else statements. The case selection structure provides multiple alternatives. It inspects a value and chooses the right path of execution that is assigned to that value. For example, a case selection structure could be used to divide the code based