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.

Programmablaufplan

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe eine Aufgabe mit einem Histogramm bekommen.

Aufgabe lautet:

Ein Programm soll einen Text einlesen, die einzelnen Wörter scannen und identifizieren, sowie ein sortiertes horizontales bzw. vertikales Histogramm der Längen dieser Wörter erstellen.

Ich musste es mit C++ programmieren und es hat auch geklappt *stolzbin*

#include <iostream>

#include <string>


using namespace std;


int main()

{

	char x='x';

	int i=0,z=0;

	int b[20]={0};

	string text;


	cout << "\nText = ? "; 

	getline(cin, text); 



while (text[i] != '\0')

{	

		if (text[i] == ' ') 

		{

			b[z]=b[z]+1;

			z=0;

		}

		else z++;


i++;

	}


b[z]=b[z]+1;


	i=0,z=0;7


	cout << "\n\n";



	while (i != 20)

	{

		if (b[i] != 0)

		{

		cout << i << " ";

			while (z < b[i])

			{

				cout << "#";

				z++;

			}

			cout << endl;

		}

		i++;

		z=0;

	}

	cout << endl << endl;

	cin.ignore();

	cin.get();

	return(0);

}

Nur jetzt soll ich einen Programmablaufplan erstellen und ich habe wirklich keine Ahnung wie ich das machen soll?!

Kann mir einer helfen?

Wäre euch sehr dankbar!

MfG DerJoe

Hab jetzt so ein PAP-Designer runtergeladen unter dem Link der bei Wikipedia angegeben ist und habe folgenden Programmablaufplan erstellt:

histogramm.png

Keine Ahnung ob das so stimmt!?

Die Abzweigungen sind noch nicht ganz richtig. Du hast da tote Enden eingebaut - es geht kein Pfeil zum eigentlichen Programm mehr zurück.

Hier ein Beispiel für die obere Abzweigung (die untere solltest Du natürlich auch korrigieren):

post-62418-14430448407278_thumb.png

Bearbeitet von Ezra

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.