<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Zählung von Vokalen in Texten.]]></title><description><![CDATA[<p>moin,</p>
<p>ich habe folgendes programm bekommen.</p>
<p>es gibt die häufigkeit aller zweiervokale aus(ohne beachtung von groß und kleinschreibung).</p>
<p>ich verstehe eigentlich auch alles bist auf das merke=-1 in der schleife im mittelteil.</p>
<pre><code class="language-cpp">/**********************  Aufgabe TEXT1  ************************/
/****************** Anzahl der DoppelVokale ********************/
/**************Christina Alberts &amp; Sven Hoffmann****************/

// Datei für Anpassung der Umlaute(Vorschlag Bartning)
#include &quot;bstream.cpp&quot;

//Deklaration der Funktionen
void ZaehleVokale(int anzahlVokale[8][8]);
void Ausgabe(int anzahlVokale[8][8]);

// Hauptprogramm
int main()
{
  int anzahlVokale[8][8], i, k;

  // Initialisierung der Variablen
  for (i = 0; i &lt; 8; i++) 
	  for (k = 0; k &lt; 8; k++) anzahlVokale[i][k]=0;

  // die Funktion liest den Text ein und ruft dann die Funktion &quot;Ausgabe&quot; auf
  ZaehleVokale(anzahlVokale);

  return(0);
}

void ZaehleVokale(int anzahlVokale[8][8]) {

  char c;
  int merke;
  merke = -1; 

  // solange bis Eingabe von &quot;$&quot;
  while (c != '$') {

	  // beliebig langer Text	
	  while (bcin.get(c)) {

        // wenn Return oder &quot;$&quot; beende diese Schleife
		if (c == '$' || c == '\n') break;

		// war das letzte Zeichen ein Vokal
		if (merke != -1) {
			if (c == 'A' || c == 'a')  anzahlVokale[merke][0]++;                
			else if (c == 'E' || c == 'e')  anzahlVokale[merke][1]++;                
			else if (c == 'I' || c == 'i')  anzahlVokale[merke][2]++;                
			else if (c == 'O' || c == 'o')  anzahlVokale[merke][3]++;                
			else if (c == 'U' || c == 'u')  anzahlVokale[merke][4]++;
			else if (c == 'Ä' || c == 'ä')  anzahlVokale[merke][5]++;                
			else if (c == 'Ö' || c == 'ö')  anzahlVokale[merke][6]++;                
			else if (c == 'Ü' || c == 'ü')  anzahlVokale[merke][7]++;
		}

		// ist das aktuelle Zeichen ein Vokal?
		if		(c == 'A' || c == 'a')  merke=0;                
		else if (c == 'E' || c == 'e')  merke=1;                
		else if (c == 'I' || c == 'i')  merke=2;                
		else if (c == 'O' || c == 'o')  merke=3;                
		else if (c == 'U' || c == 'u')  merke=4;
		else if (c == 'Ä' || c == 'ä')  merke=5;                
		else if (c == 'Ö' || c == 'ö')  merke=6;                
		else if (c == 'Ü' || c == 'ü')  merke=7;
		else merke=-1;

	  }

	  // Nach jedem Return die Anzahl anzeigen
	  Ausgabe(anzahlVokale);
	  merke=-1;

  } 		

}

void Ausgabe(int anzahlVokale[8][8]) {
  // die möglichen Umlaute im Text	
  char vokal[] = {'a','e','i','o','u','ä','ö','ü'};
  int i, k;	

  // Ausgabe der kumulierten Doppelvokale	
  for (i = 0; i &lt; 7; i++) 
	  for (k = 0; k &lt; 7; k++) 
		if (anzahlVokale[i][k]&gt;0)	
		  bcout &lt;&lt; anzahlVokale[i][k] &lt;&lt; &quot;x &quot; &lt;&lt; vokal[i] &lt;&lt; vokal[k] &lt;&lt;&quot;\n&quot;;

}
</code></pre>
<p>kann mir da wer helfen?</p>
<p>danke schon mal im voraus</p>
<p>gruss</p>
<p>elwood</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/251303/zählung-von-vokalen-in-texten</link><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 14:30:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/251303.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Oct 2009 12:51:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zählung von Vokalen in Texten. on Fri, 02 Oct 2009 12:51:53 GMT]]></title><description><![CDATA[<p>moin,</p>
<p>ich habe folgendes programm bekommen.</p>
<p>es gibt die häufigkeit aller zweiervokale aus(ohne beachtung von groß und kleinschreibung).</p>
<p>ich verstehe eigentlich auch alles bist auf das merke=-1 in der schleife im mittelteil.</p>
<pre><code class="language-cpp">/**********************  Aufgabe TEXT1  ************************/
/****************** Anzahl der DoppelVokale ********************/
/**************Christina Alberts &amp; Sven Hoffmann****************/

// Datei für Anpassung der Umlaute(Vorschlag Bartning)
#include &quot;bstream.cpp&quot;

//Deklaration der Funktionen
void ZaehleVokale(int anzahlVokale[8][8]);
void Ausgabe(int anzahlVokale[8][8]);

// Hauptprogramm
int main()
{
  int anzahlVokale[8][8], i, k;

  // Initialisierung der Variablen
  for (i = 0; i &lt; 8; i++) 
	  for (k = 0; k &lt; 8; k++) anzahlVokale[i][k]=0;

  // die Funktion liest den Text ein und ruft dann die Funktion &quot;Ausgabe&quot; auf
  ZaehleVokale(anzahlVokale);

  return(0);
}

void ZaehleVokale(int anzahlVokale[8][8]) {

  char c;
  int merke;
  merke = -1; 

  // solange bis Eingabe von &quot;$&quot;
  while (c != '$') {

	  // beliebig langer Text	
	  while (bcin.get(c)) {

        // wenn Return oder &quot;$&quot; beende diese Schleife
		if (c == '$' || c == '\n') break;

		// war das letzte Zeichen ein Vokal
		if (merke != -1) {
			if (c == 'A' || c == 'a')  anzahlVokale[merke][0]++;                
			else if (c == 'E' || c == 'e')  anzahlVokale[merke][1]++;                
			else if (c == 'I' || c == 'i')  anzahlVokale[merke][2]++;                
			else if (c == 'O' || c == 'o')  anzahlVokale[merke][3]++;                
			else if (c == 'U' || c == 'u')  anzahlVokale[merke][4]++;
			else if (c == 'Ä' || c == 'ä')  anzahlVokale[merke][5]++;                
			else if (c == 'Ö' || c == 'ö')  anzahlVokale[merke][6]++;                
			else if (c == 'Ü' || c == 'ü')  anzahlVokale[merke][7]++;
		}

		// ist das aktuelle Zeichen ein Vokal?
		if		(c == 'A' || c == 'a')  merke=0;                
		else if (c == 'E' || c == 'e')  merke=1;                
		else if (c == 'I' || c == 'i')  merke=2;                
		else if (c == 'O' || c == 'o')  merke=3;                
		else if (c == 'U' || c == 'u')  merke=4;
		else if (c == 'Ä' || c == 'ä')  merke=5;                
		else if (c == 'Ö' || c == 'ö')  merke=6;                
		else if (c == 'Ü' || c == 'ü')  merke=7;
		else merke=-1;

	  }

	  // Nach jedem Return die Anzahl anzeigen
	  Ausgabe(anzahlVokale);
	  merke=-1;

  } 		

}

void Ausgabe(int anzahlVokale[8][8]) {
  // die möglichen Umlaute im Text	
  char vokal[] = {'a','e','i','o','u','ä','ö','ü'};
  int i, k;	

  // Ausgabe der kumulierten Doppelvokale	
  for (i = 0; i &lt; 7; i++) 
	  for (k = 0; k &lt; 7; k++) 
		if (anzahlVokale[i][k]&gt;0)	
		  bcout &lt;&lt; anzahlVokale[i][k] &lt;&lt; &quot;x &quot; &lt;&lt; vokal[i] &lt;&lt; vokal[k] &lt;&lt;&quot;\n&quot;;

}
</code></pre>
<p>kann mir da wer helfen?</p>
<p>danke schon mal im voraus</p>
<p>gruss</p>
<p>elwood</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1787323</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1787323</guid><dc:creator><![CDATA[elwoodblues87]]></dc:creator><pubDate>Fri, 02 Oct 2009 12:51:53 GMT</pubDate></item><item><title><![CDATA[Reply to Zählung von Vokalen in Texten. on Fri, 02 Oct 2009 12:54:57 GMT]]></title><description><![CDATA[<p>Was mir als allererstes ins Auge fällt:</p>
<pre><code class="language-cpp">#include &quot;bstream.cpp&quot;
</code></pre>
<p>Tippfehler oder ernst gemeint?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1787324</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1787324</guid><dc:creator><![CDATA[It0101]]></dc:creator><pubDate>Fri, 02 Oct 2009 12:54:57 GMT</pubDate></item><item><title><![CDATA[Reply to Zählung von Vokalen in Texten. on Fri, 02 Oct 2009 13:09:43 GMT]]></title><description><![CDATA[<p>Hallo Elwood,<br />
es sieht zwar nicht ganz schick aus aber scheint sicher den Zweck zu erfüllen. Es gibt 9 Fälle die eintretten könne. 0 - 7 es handelt sich um ein Vokal und -1 es ist kein Vokal. Die Variable merke sichert also mit -1 den Zustand das der letzte Buchstabe kein Vokal war, in diesem Fall würde folgender Teil im Code übersprungen</p>
<pre><code class="language-cpp">// war das letzte Zeichen ein Vokal
        if (merke != -1) {
            if (c == 'A' || c == 'a')  anzahlVokale[merke][0]++;                
            else if (c == 'E' || c == 'e')  anzahlVokale[merke][1]++;                
            else if (c == 'I' || c == 'i')  anzahlVokale[merke][2]++;                
            else if (c == 'O' || c == 'o')  anzahlVokale[merke][3]++;                
            else if (c == 'U' || c == 'u')  anzahlVokale[merke][4]++;
            else if (c == 'Ä' || c == 'ä')  anzahlVokale[merke][5]++;                
            else if (c == 'Ö' || c == 'ö')  anzahlVokale[merke][6]++;                
            else if (c == 'Ü' || c == 'ü')  anzahlVokale[merke][7]++;
        }
</code></pre>
<p>Dieser ist für das Zählen verantortlich. Sollte merke aber 0 - 7 halten, dann wird der dazu gehörige Zählerwert erhöt. Was etwas komisch organisiert ist, dass das Erkennen um was es sich handelt (Vokal oder nicht) nach dem Zählerpart realisiert wurde?!</p>
<p>Sprich, es wird ein Zeichen eingelesen -&gt; dann wird erst geguckt, ob die letzte Eingabe ein Vokal war -&gt; dann erst wird aktuelles Zeichen ausgewertet udn erst im nächsten Schleifendurchlauf wird dieses betrachtet. Dies ist ziemlich schlecht organisiert.</p>
<p>Tipp:<br />
- arbeite mit switch-case Anweisungen<br />
- spar dir Indentifikationsflag</p>
<p>Also:</p>
<pre><code class="language-cpp">// Lese Zeichen ein und speichere es in c

switch( c ) {

    case 'a':
    case 'A': //zähle a hoch
    ...
    case 'ä':
    case 'Ä': //...

    default: //ansonsten mache nichts
}
</code></pre>
<p>Hoffe das hilft dir etwas.</p>
<p>Lg Tobi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1787335</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1787335</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Fri, 02 Oct 2009 13:09:43 GMT</pubDate></item><item><title><![CDATA[Reply to Zählung von Vokalen in Texten. on Fri, 02 Oct 2009 13:11:39 GMT]]></title><description><![CDATA[<p>ernst gemeint.</p>
<p>header-datei, die auch deutsche umlaute wie ä,ö etc. erfassen kann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1787340</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1787340</guid><dc:creator><![CDATA[elwoodblues87]]></dc:creator><pubDate>Fri, 02 Oct 2009 13:11:39 GMT</pubDate></item><item><title><![CDATA[Reply to Zählung von Vokalen in Texten. on Fri, 02 Oct 2009 13:19:23 GMT]]></title><description><![CDATA[<p>vielen dank für die schnelle hilfe tobi, hast mir echt geholfen.<br />
mache mich gleich ans werk;-)</p>
<p>probiers gleich mal mit nem switch aus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1787344</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1787344</guid><dc:creator><![CDATA[elwoodblues87]]></dc:creator><pubDate>Fri, 02 Oct 2009 13:19:23 GMT</pubDate></item><item><title><![CDATA[Reply to Zählung von Vokalen in Texten. on Fri, 02 Oct 2009 13:47:15 GMT]]></title><description><![CDATA[<p>also wenn es eine header-datei ist, sollte die nicht &quot;.cpp&quot; heißen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> Das ist aus meiner Sicht mehr als unüblich <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1787359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1787359</guid><dc:creator><![CDATA[It0101]]></dc:creator><pubDate>Fri, 02 Oct 2009 13:47:15 GMT</pubDate></item><item><title><![CDATA[Reply to Zählung von Vokalen in Texten. on Fri, 02 Oct 2009 14:37:26 GMT]]></title><description><![CDATA[<p>It0101 schrieb:</p>
<blockquote>
<p>Das ist aus meiner Sicht mehr als unüblich <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
</blockquote>
<p>Es ist so gar falsch, weil jede Entwicklungsumgebung *.cpp automatisch parst und dann dazulinkt - sollte also auf jeden Fall eine Verletzung der ODR zur Folge haben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1787375</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1787375</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Fri, 02 Oct 2009 14:37:26 GMT</pubDate></item></channel></rss>