FUNDAMENTALS OF COMPUTER

COMPUTER PROGRAMMING FUNDAMENTALS

WHAT IS PROGRAMMING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Why is selection important?
A
Selection allows a number of steps to be repeated
B
Selection allows multiple paths through a program
C
Selection determines the order in which instructions are carried out
D
None of the above
Explanation: 

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: -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-3: -This is described as either two-way selection or multi-way selection. A question using Boolean concepts usually controls which path is selected. All of the paths from a selection control structure join back up at the end of the control structure, before moving on to the next lines of code in a program.

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: -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.

There is 1 question to complete.