Präsentation herunterladen
1
Software Engineering Struktogramme
Dipl. Ing. Päd. Huwaldt
2
Strukturierter Entwurf
Methoden für die implementationsnahe Beschreibung von Softwaresystemen. Zielstellung ist die Definition der Programmstruktur und des Programmablaufs. Weit verbreitete Techniken sind der Programmablaufplan und das Struktogramm. Grundidee: Bausteinprinzip. Jedes Programm wird nur aus drei Grundelementen (Sequenz, Alternative, Wiederholung) zusammengesetzt. Struktogramme Dipl. Ing. Päd. Huwaldt
3
Grundelemente (Text, Programmablaufplan, Struktogramm)
Sequenz Führe erst A dann B dann C aus! A B C A B C A B Iteration Wiederhole A solange bis Bedingung B wahr ist! B A B C JA NEIN Wenn Bedingung B wahr ist, führe A aus. Sonst führe C aus. Alternative JA NEIN B A C A Struktogramme Dipl. Ing. Päd. Huwaldt
4
Sequenz (Folge von Anweisungen)
Bildschirmausgabe B Bildschirmausgabe C Bildschirmausgabe D Als Programm function A() { printf (“B“); printf (“C“); printf (“D“); } Struktogramme Dipl. Ing. Päd. Huwaldt
5
Alternative if ( bedingung = wahr ) printf (“E“); else printf (“F“);
Ja Nein Bildschirmausgabe E F Als Programm if ( bedingung = wahr ) printf (“E“); else printf (“F“); Struktogramme Dipl. Ing. Päd. Huwaldt
6
Alternative ohne „sonst“ (bedingte Ausführung)
Bedingung Ja E if ( bedingung == wahr ) printf (“E“); Struktogramme Dipl. Ing. Päd. Huwaldt
7
Alternative Bedingung A= A= A=3 D E F G A=1 Ja Nein F A=2 Ja Nein E A=3 Ja Nein G D if ( A==1 ) printf (“E“); else if ( A==2 ) printf (“F“); else if ( A==3 ) printf (“F“); else printf (“F“); Struktogramme Dipl. Ing. Päd. Huwaldt
8
Wiederholung (Kopfgesteuert = Bedingung wird am Anfang geprüft)
Anzahl <2 Bildschirmausgabe G Anzahl+1 Als Programm while ( anzahl < 2 ) { printf (“G“); anzahl=anzahl+1; } Struktogramme Dipl. Ing. Päd. Huwaldt
9
Wiederholung (Fußgesteuert = Bedingung wird am Ende geprüft)
Anzahl <2 G Anzahl+1 do{ printf (“G“); anzahl=anzahl+1; }while ( anzahl < 2 ); Struktogramme Dipl. Ing. Päd. Huwaldt
10
Strukturen F E A B C G Bedingung Anzahl < 2 Struktogramme
Dipl. Ing. Päd. Huwaldt
11
Strukturen kann man zusammensetzen
B F E Bedingung G Anzahl < 2 Struktogramme Dipl. Ing. Päd. Huwaldt
12
Strukturen A Ja nein function A(int anzahl) {
printf („A“); if ( bedingung = wahr ) print (“E“); else print (“F“); print (“B“); while ( anzahl < 2 ) { print (“G“); anzahl=anzahl+1; } } A B F E Bedingung G Anzahl < 2 Ja nein Struktogramme Dipl. Ing. Päd. Huwaldt
13
Strukturierte Programmierung in SiSy
main init BS Aufbau Eingabeaufforderung Menüauswahl Ausleihe Rückgabe Statistik Stammdaten ende deinit 1 2 3 4 5 Mit F8 generiert Struktogramme Dipl. Ing. Päd. Huwaldt
Ähnliche Präsentationen
© 2024 SlidePlayer.org Inc.
All rights reserved.