Selection Structure

Submitted by: Submitted by

Views: 251

Words: 283

Pages: 2

Category: Science and Technology

Date Submitted: 10/05/2013 02:08 PM

Report This Essay

Selection Structure

Joseph Bonita

PRG/211

April-8th, 2012

Marcus Fernandez

Selection Structure

The proposal is to develop a distant learning program. There are several structures that can be developed for this program. The structures that will be explained here will be iteration and selection structures.

“Structured programming (sometimes known as modular programming) is a subset of procedural programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify. Certain languages such as Ada, Pascal, and dBASE are designed with features that encourage or enforce a logical program structure.

Structured programming frequently employs a top-down design model, in which developers map out the overall program structure into separate subsections. A defined function or set of similar functions is coded in a separate module or submodule, which means that code can be loaded into memory more efficiently and that modules can be reused in other programs. After a module has been tested individually, it is then integrated with other modules into the overall program structure” (Rouse, 2005).

An iteration structure also known as a loop is used when you repeat an action until a condition is met. Statements that can be used in iteration structures are IF, WHILE, FOR, and DO.

A selection structure requires a condition statement so that if the condition is true and action is executed or if the condition is false a different action is executed.

Pseudocode:

Begin

Get Student_ID

Get Password

IF Student_ID equals Password THEN display "You are logged in "

ELSE display "Incorrect login "

End

Reference:

Rouse, M. (2005, August). Structured programming (modular programming).

TECHTARGET.COM, (),. Retrieved from

http://searchcio-midmarket.techtarget.com/definition/structured-programming