|title||Information processing; Symbols for structograms according to Nassi-Shneiderman|
A Nassi-Shneiderman diagram is a type of diagram used to represent draft programs as part of the structured programming method . It was developed in 1972/73 by Isaac Nassi and Ben Shneiderman and is standardized in DIN 66261. Since Nassi-Shneiderman diagrams represent program structures, they are also known as structured diagrams .
The method breaks down the overall problem that you want to solve with the desired algorithm into smaller and smaller sub-problems - until finally only elementary basic structures such as sequences and control structures remain to solve the problem. These can then be visualized using a Nassi-Shneiderman diagram or a program flow chart (PAP). The procedure corresponds to so-called top-down programming, in which an overall concept is first developed, which is then resolved by refining the structures of the overall concept.
Böhm and Jacopini demonstrated in 1966 that any algorithm can be formulated without an unconditional jump instruction (GOTO). The control structures of modern programming languages can be found trivially for Nassi-Shneiderman diagrams ; this can be much more difficult for program flow charts.
Symbols after Nassi-Shneiderman
Most of the following structure blocks can be nested within one another. The structogram, made up of the different structural blocks, is on the whole rectangular, i.e. just as wide as its widest structural block.
Each instruction is written in a rectangular structure block.
The structure blocks are passed through one after the other from top to bottom.
Empty structure blocks are only permitted in branches.
Alternative terms: sequence, linear process, sequence.
Alternative terms: branching, alternative, selection.
1 possible block
Instruction block 1 is run through (
Alternative terms: conditional processing, simple selection / selection, simple branching.
2 possible blocks
If the condition is true, statement block 1 is run through; if the condition does not apply (false), instruction block 2 is run through (
Alternative terms: single alternative, double choice, alternative branching / processing.
Example of nesting
Another condition follows. Nesting is also still possible in the case of no.
Repetition structure in which the number of runs is specified (
Alternative terms: counter-controlled loop.
Alternative terms: repetition with conditional checking, checking loop.
Special case: End = true
Repetition structure with a preceding conditional check (
Alternative terms: repetition with a preceding condition test, rejecting / pre-checking / head-controlled loop.
Special case: Begin = true
Repetition structure with subsequent conditional check for termination (
Alternative terms: repetition with subsequent conditional test, non-repellent / checking / foot-controlled loop.
Special case: Begin = End = true
Repetition structure that can only be left with an abort instruction (
Alternative terms: repetition without a conditional check, endless loop.
The exit (
Alternative terms: termination instruction, exit.
Symbol for calling a subroutine or a procedure , function or method . After it has run through, a jump is made back to the calling point and the next structure block is run through. This symbol is not standardized.
Parallel processing symbol
Symbol for the concurrent flow of several blocks.
Structograms should not contain any programming language-specific command syntax. They must be formulated independently of the programming language in such a way that the logic shown can be easily understood and implemented as a coding rule in any programming language.
Because they were originally developed for procedural programming languages, only the procedure and no declaration areas of variables and constants were shown in structograms (simple structogram). However, it is not immediately clear which data type must be assigned to a variable. The declaration of variables and constants is to be made in the first statement block. These Nassi-Shneiderman diagrams are then called extended structograms.
Each instruction has its own structure block (symbols according to DIN 66261). Even several statements of the same or similar type may not be combined in one structure block.
Each instruction must consist of at least one assignment (for example target variable ← target variable * other variable ). An assignment is shown by an arrow pointing to the left. Older structograms, from old Pascal times, use the colon followed by the equal sign as an alternative ( target variable : = target variable * other variable ). The target of an instruction is always to the left of the assignment symbol. To the right of this is the source.
A name belongs to each structogram in order to be able to guarantee the identification by event or (sub) program calls.
Structograms are used in computer science lessons at upper secondary level so that students can train the development of logical processes that are necessary for programming. The creation of structure diagrams on the basis of descriptions of operational problems, which can be automated because the same procedure is repeated, is still part of many school final exams.
Nassi-Shneiderman diagrams can also be used in technical documentation .
|as a Nassi-Shneiderman diagram ...||... and in Python :|
def GGT(a, b): while a > 0 and b > 0: if a > b: a -= b else: b -= a if b == 0: return a else: return b
as a Nassi-Shneiderman diagram ...
... and the implementation in VBA :
Option Explicit Private Sub btnZensur_Click() Dim intZensur As Integer, strZensur As String intZensur = InputBox("Geben Sie die Zensur als Zahl ein.") Select Case intZensur Case 1: strZensur = "sehr gut" Case 2: strZensur = "gut" Case 3: strZensur = "befriedigend" Case 4: strZensur = "ausreichend" Case 5: strZensur = "mangelhaft" Case 6: strZensur = "ungenügend" Case Else: strZensur = "ungültig" End Select MsgBox "Ihre eingegebene Zensur in Worten: " & strZensur End Sub
- Literature on the Nassi-Shneiderman diagram in the catalog of the German National Library
- DIN 66261: Symbols for structograms according to Nassi-Shneiderman . Bielefeld University of Applied Sciences . Archived from the original on September 28, 2007. Retrieved June 2, 2016.