COMPUTER SCIENCE AND ENGINEERING
ALGORITHMS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Selection allows us to include more than one path through a solution
|
|
Selection allows us to repeat steps in a solution
|
|
Selection allows us make our solution more efficient
|
|
None of the above
|
Detailed explanation-1: -Selection allows there to be more than one path through a program. Many solutions feature several choices or decisions. These decisions lead to different paths through the program. These paths represent the result of making a choice.
Detailed explanation-2: -Using IF and ELSE gives two possible choices (paths) that a program can follow. However, sometimes more than two choices are wanted. To do this, the statement ELSE IF is used.
Detailed explanation-3: -Selection is a programming construct where a section of code is run only if a condition is met. In programming, there are occasions when a decision needs to be made. Selection is the process of making a decision. The result of the decision determines which path the program will take next.
Detailed explanation-4: -The switch statement evaluates an expression, matches the expression’s value to a case clause, and executes statements associated with that case. Switch statements and enumerations are often used together to improve the readability of the code.
Detailed explanation-5: -Why is sequencing important? It is crucial that the steps in an algorithm are performed in the right order-otherwise the algorithm will not work correctly.