Essay: Selection and Repetition Control Structures

Essay: Selection and Repetition Control Structures
April 12, 2011 Comments Off on Essay: Selection and Repetition Control Structures Academic Papers on Information Technology,Sample Academic Papers admin

Sample Essay

The selection control and repetition control structures are two of the most powerful structures in any programming language and play a critical role in increasing the power and usefulness of the program as well as providing ease to the programmer to code a wide range of functionality in its programs.

The use of selection control structures enables the programmer to write powerful programs. A scenario which is always faced by programmers writing large programs is when an operation needs to be performed only when a certain condition is true. In the absence of a selection control structure, this scenario would be impossible to implement. Thus, such programs would not be able to provide functionality beyond simple tasks. The use of selection control structure enables the programmer to add more functionality to the programs by specifying conditions of when and how a particular set of instruction would be run. Furthermore, the selection control structure allows the decision for running such instructions to be based on two or more conditions while also allowing the flexibility of running code when either one of the specified conditions is true (Deitel & Deitel, 2009).

There are four selection control structures that are commonly used in almost every language that is used for software development. The simple selection structure allows for a set of code to be executed based on only one condition.  Further flexibility is added by o Simple selection with null false branch structure, while not only allows the execution of a set of instruction to be executed when a condition is true but also allows for specification of an alternate code which is executed when the condition is not met. On the other hand, the combined control structure allows the programmer to specify two or more condition and also if the set of instruction will only execute if all conditions are true. The nested selection structure is also very significant. It allows for conditioning the execution of the conditional code (Soulie, 2009). The importance of selection control structure can be signified from tasks that we perform in our daily routine. For example, consider the act of a person having a meal. The whole process of having a meal is based on the condition that a person feels hungry. That is, the person checks if he feels hungry and if he does then he goes for a break to eat otherwise he continues to do what he was doing before. After he finishes hi meal, he checks if he needs to drink water and does so if he needs some. This is a great example of use of nested selection structure n which the first condition checks for the person being hungry or not  while the second condition is used for checking if he is thirsty after having his meal so that can have some water afterwards. Without the presence of selection structure, a person would either starve to death because he won’t be able to check if he is hungry or not. Even if he takes his meal he would die of thirst as the condition for checking if he is thirsty or not.

The nested selection structure is also very significant. It allows for conditioning the execution of the conditional code (Soulie, 2009). The importance of selection control structure can be signified from tasks that we perform in our daily routine. For example, consider the act of a person having a meal. The whole process of having a meal is based on the condition that a person feels hungry. That is, the person checks if he feels hungry and if he does then he goes for a break to eat otherwise he continues to do what he was doing before. After he finishes hi meal, he checks if he needs to drink water and does so if he needs some. This is a great example of use of nested selection structure n which the first condition checks for the person being hungry or not  while the second condition is used for checking if he is thirsty after having his meal so that can have some water afterwards. Without the presence of selection structure, a person would either starve to death because he won’t be able to check if he is hungry or not. Even if he takes his meal he would die of thirst as the condition for checking if he is thirsty or not.

Please go to the order form to order essays, research papers, term papers, thesis, dissertation, case study, assignments on this essay topic.

Related Essays, Research Papers, Term Papers, Thesis, Dissertation, Case Study, Assignments entries.

...

BUY CUSTOM ESSAY

...

Tags
About The Academic Paper