Q: Explain about 'Structured Programming:
Ans:
- A program is called structured
- when it uses only the following types of constructs:
* sequence,
* selection,
* iteration
- Unstructured control flows are avoided.(example GOTO statement)
- Consist of a neat set of modules.
- Use single-entry, single-exit program constructs.
- However, violations to this feature are permitted:
- due to practical considerations such as:
* premature loop exit to support exception handling.
- Structured programs are:
- Easier to read and understand,
- easier to maintain,
- require less effort and time for development.
- Research experience shows:
- programmers commit less number of errors
* while using structured if-then-else and do-while statements
* compared to test-and-branch constructs.
Important advantages of structured programming.
Structured programs are easier to read and understand. Structured programs are easier to maintain. They require less effort and time for development. They are amenable to easier debugging and usually fewer errors are made in the course of writing such programs.
No comments:
Post a Comment