Header Ads Widget

Responsive Advertisement

Module 2: Introduction to Structured Programming

Introduction to Structured Programming


1. What is Structured Programming? What are the benefits of structured programming?

Structure Programming: A collection of techniques for the planning and writing of programs that increase programmer productivity. Such as, top-down programming and the use of loop, selection and sequence structure.

Benefits of Structured Programming:

i. Application programs are easier to read and understand.

ii. Application programs are less likely to contain logic errors.

iii. Errors are more easily found.

iv. Higher productivity during application program development.

v. Improved application program design.

vi. Application programs are more easily maintained.


2. What do you mean by Modular Programming?

Modular Programming: Modular Programming is an early stage in the development of structured programming. A program is broken down into pieces, or modules which can be coded and tested separately called modular programming.


3. What is subroutine? What do you mean by internal and external subroutine?

Subroutine: Subroutine is a set of instructions for performing a particular task which can be called when needed.

Internal subroutine: An internal subroutine is a part of the program. It is a set of instructions for performing a particular task that is written as a part of the using program.

External subroutine: External subroutine is a set of instructions for performing a particular task that can be used by any program because the instructions reside in a library that is external to the using program.


4. What is structure chart?

Structure chart: Structure chart is a tool to use in the top-down planning of a structured program that shows the modules that comprise the program.


5. Describe the three logic pattern or structure of structured programming. Give an Overview of Structured Forms.

i. Sequences structure

ii. Iteration/loop structure

iii. Selection structure

Sequence Structure: Sequence Structure is one of the three fundamental programming structures. It provides for the execution of instruction in the order in which they are encountered. No special logic is required because processing is always sequential.

Iteration /Loop Structure: The loop structure provides for the repetition of one or more instructions for as long as a given situation, referred to as a condition exists. An iteration is the repeated processing of the same code while, or until, a condition is true.

Selection Structure: A selection is the choice between two or more functions to be processed based on a condition.


6. What is pseudocode ? What is the limitation of pseudocode?

Pseudocode is a way to represent instruction that uses ordinary English. It is a planning tool for structured programming.

Limitations of pseudocode :

i. There is no accepted structure of Pseudocode.

ii. Psuedocode use the ordinary English.


7. Define: the following: Dummy Module, Priming Read, Condition

Dummy Module : A dummy run is a trial or test procedure which is carried out in order to see if a plan or process works properly.

Priming Read: When we read a sentinel value to control a while loop we have to get the first value from user before we encounter the loop so that it will be tested and the loop can be entered. This is known as a priming read.

Condition: A situation which may be true or false, user to control a loop or  a select form among two alternatives for processing.


8. What are the problems with the modular programming approach?

The modular programming approach initially met with some resistance from programmers because it restricted their activities. When positions of a program are allocated to different programmers, no one program can be said to “own” the program; instead it belong to a team.


9. What do you mean by main program module?

Each Program contains a main program module which ultimately controls everything that happens.


10. How does modular programming work?

Modular programming works by breaking down a single program into modules (pieces), each of which performs a single, limited function and is written and debugged separately from other modules. Because the purpose and size of each module are limited, the likelihood of errors is reduced.


11. What are the difference between flowchart and structural chart?

Structure chart is a tool for planning the structure of a program. It show the functions to be performed and the relationship between modules, but it usually provides too little information to serve as a basis for coding a program.

Flowchart show exact processing steps for coding the program.

Structure chart requires less revisions but flowchart requires more revision.

Structure chart is easier than flowchart for a user to understand.


12. Define the following Keywords:

Call: Instruction that transfers control to a subroutine.

Condition: Condition is a situation which may be true or false used to control a loop or to select from among two alternatives for processing.

DO WHILE: The representation of the loop structure in pseudo code.

Dummy record: A record placed at the end of a file to signal that there is no more data to be processed.

External Subroutine: A set of instructions for performing a particular task that can be used by any program because the instructions reside in library that is external to the using program.

GOTOless Programming: GOTOless Programming is programming without the use of branch instructions.

Hierarchy Chart: Hierarchy Chart is another name for structure chart. It is a tool for top-down program planning.

IF-THEN-ELSE: The representation of the selection structure in pseudo code.

Internal subroutine: A set of instruction for performing a particular a particular task that is written as a part of the using program.

I/O: input /output

Loop structure: The loop structure provides for the repetition of one or more instructions for as long as a given situation, referred to as a condition exists . An iteration is the repeated processing of the same code while, or until, a condition is true.

Modular programming: An early stage in the development of programming. A program is broken down into pieces, or modules which can be coded and tested separately.

Module: A piece of a program that performs a single, limited function.

Nested:  Nested means included within another, as a loop structure within another loop structure (nested loop), or a selection structure within another selection structure (nested IF).

Null ELSE: A situation in which no action is taken if the condition for an IF-THEN-ELSE is false.

Priming Read: Reading the first record in a file prior to entering  a loop that is executed until EOF is detected.

Pseudo code: A way to represent instruction that uses ordinary English; a planning tool for structure programming.

Return: This instruction within a subroutine that returns control to the calling program.

Selection structure: One of the three fundamental programming structure; provides the ability to choose between two alternative courses of action on the basis of whether a condition is true or false.

                    

Sequence structure:  Sequence Structure is one of the three fundamental programming structures. It provides for the execution of instruction in the order in which they are encountered.

Structure chart: A tool to use in the top-down planning of a structured program that shows the modules that comprise the program, and also shows the modules called by each module.

Structure programming: A collection of techniques for the planning and writing of programs that increases programmer productivity, e.g., top-down programming and the use of loop , selection , and sequence structures.

Subroutine: A set of instructions for performing a particular task can be called when needed.

Top-down programming: A technique for planning a structure program in which the entire program is first broken down into three modules:

i. The processing that takes place before any data is processed

ii. The processing of the data, and

iii. The processing that takes place after all data records have been read. These modules in turn are successively subdivided until each module performs a single, limited function.                                                                            

User: The people who will use the output produced by the computer.

VTOC (Visual table of contents): Another name for a structure chart; a tool for the top down planning of a structure program.

IOCS: Input Output Control System. It is a part of the Operating System of a computer that handles the reading and writing of records.

Post a Comment

0 Comments