Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Struktogramm (Nassi-Shn.) mit Arrays (C#)

Empfohlene Antworten

Veröffentlicht

Moin

Folgendes Problem: Wir müssen zu jeder Syntax, die wir schreiben, vorher ein NS-Diagramm anfertigen. Soweit so gut, allerdings nicht unbedingt meine Stärke, und auch gerade in der Stunde, in der was neues erklärt wurde, nämlich Arrays, war ich nicht da und mir fehlt der Stoff.

Short story long, kann mir einer zufällig sagen oder an eine Quelle verweisen, wie man ganz allgemein Arrays in einem Struktogramm festhält? Verzweigung, Schleifen, Fallauswahl etc. ist klar, nur die Arrays eben nicht. Die Syntax einer Übungsaufgabe steht unten, falls die weiter hilft. Ich such mir hier jetzt nen Wolf und außer Verweisen auf Editoren ist nichts bei rumgekommen.


        static void Main(string[] args)

        {

            double umsatz;

            int monat,i;

            Double[] monatstab;


            monatstab = new double[12];


            monat = EingabeInt(0, 12, "");


            while (monat != 0)

            {

                umsatz = EingabeDouble("Bitte Umsatz eingeben");

                monat = monat - 1;

                monatstab[monat] = monatstab[monat] + umsatz;

                monat = EingabeInt(0,12,"Bitte Monat eingeben");

            }


            monat = 0;


            for (i = 0; i < 12; i++)

            {

                Console.Write((monat + 1) + monatstab[monat]);

                monat = monat + 1;

            }

        }


        static int EingabeInt(int UG, int OG, string text)

        {

            int zahl;

            string eingabe;

            Console.Write(text);

            eingabe = Console.ReadLine();

            zahl = Convert.ToInt32(eingabe);


            return zahl;

        }

        static double EingabeDouble(string text)

        {

            double zahl;

            string eingabe;

            Console.WriteLine(text);

            eingabe = Console.ReadLine();

            zahl = Convert.ToDouble(eingabe);

            return zahl;

       }

So weit war ich auch schon. Aber wie du sehen kannst steht da nichts von der gefragten Form für Arrays

Struktogramme zeigen Abläufe und Kontrollstrukturen, keine Variablentypen. Soweit ich weiß, gibt es keine formale Vorgabe für die Kennzeichnung von Arrays.

Ich würde die Schreibweise mit den eckigen Klammern einfach übernehmen. Kann natürlich sein, dass dein Dozent etwas anderes vorgegeben hat.

So weit war ich auch schon. Aber wie du sehen kannst steht da nichts von der gefragten Form für Arrays

AFAIK hat das seinen Grund darin, dass es da auch keine Vorgabe gibt. Im Grunde arbeitest Du mit Pseudo-Code. Wir haben häufig eine Art Pseudo-Pascal verwendet, wahlweise war auch Pseudo-C gestattet.

http://de.wikipedia.org/wiki/Adele_(Algorithmenbeschreibungssprache) ist sinnvoll, wenn man eine gemeinsame Basis sucht.

Alles klar. Die Firma dankt. :)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.