Programming Development Part 2

Programming Development Part 2 - The purpose of this paper...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
The purpose of this paper is to describe the purpose of a selection structure. At the end of this paper, there will be a pseudocode of the Personal Learning Management Program using that structure. The selection structure has a few types, and depending on the type of program you are writing will be the one to use. To get a better insight of a selection structure you will have to know exactly what a selection structure is, the different types of selection structures, and an example of those types of selection structures. First, in order to describe the types and examples of the different selection structures, a description of what a selection structure is needed. In a selection structure which is also known as a decision structure, “there is a branch forward at some point, which causes a portion of the program to be skipped. Thus, depending upon a given condition at the branch point, a certain block of statements will be executed while another is skipped” (Venit & Drake, 2011, " Chapter 2: Developing a Program"). “The most common selection (or “decision”) structure is the IF statement. The IF statement begins with a condition, followed by a block of statements that execute only when the condition evaluates to true, and an optional block of statements that execute only when the condition evaluates to false. The two blocks are called the true block and the false block (for obvious reasons). The IF statement ends where the two blocks reconnect” Second, selection structures have three different types. They are similar in some ways and they have differences as well. The different types are single-alternative, dual-alternative, and multiple-alternative structures. The first structure is a single-alternative structure, which is also known as If-Then, has one statement. If the result is true, then the program is executed. If it is false, then the statement in the program is not executed. The second structure is a dual- alternative, which is also known as If-Then-Else, has two groups of statements. In this structure if the result is true the first group is executed. If it is false, then the second group is executed. The third group is the multiple-alternative structure, has more than two groups. In this structure if the result is true it will skip the other groups of statements. Third, to understand these structures more, here are some examples of them. An example of the single-alternative structure is, suppose you have a program that asks a question, “Do you have any siblings? Type Y for yes, N for no”. If the user types yes, then the program will ask
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/08/2012 for the course CGS 3269 taught by Professor Staff during the Fall '08 term at University of Central Florida.

Page1 / 7

Programming Development Part 2 - The purpose of this paper...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online