<?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[Bedingte Verzweigungen die 2.]]></title><description><![CDATA[<p>Die Aufgabe geht weiter... Der erste TEil bis zum Ausrechnen des Durchschnitts klappt. Dann soll in Abhängigkeit der Durchschnittsnote die übliche Bezeichnung ausgegeben werden... Aber das Programm gibt immer nur Sehr Gut aus.... Was mach ich falsch???</p>
<p>Schon im voraus Danke!!</p>
<pre><code class="language-cpp">int main ()
{

int notenanzahl=0; 
float summe=0; 
int note = 0; 
float durchschnitt=0; 
do 
{ 
 cout&lt;&lt; &quot;Bitte die Note eingeben: &quot;;
 cin&gt;&gt; note; 

 summe=summe+note; 
 notenanzahl++; 
}
while(note!=0); 
notenanzahl--;   

durchschnitt=summe/notenanzahl; 
cout&lt;&lt; &quot;Die Durchschnittsnote ist: &quot;&lt;&lt; durchschnitt &lt;&lt;endl; 

if (durchschnitt = '1')
{
	cout  &lt;&lt; &quot;Sehr Gut! &quot;;
}

else if (durchschnitt = '2')
{
	cout &lt;&lt; &quot;Gut!&quot;;
}

else if (durchschnitt = '3')
{
	cout &lt;&lt; &quot;Befriedigentd!&quot;;
}
else if (durchschnitt = '4')
{
	cout &lt;&lt; &quot;Genügend!&quot;;
}
else if (durchschnitt = '5')
{
	cout &lt;&lt; &quot;Die Allgemeinen Leistungen sind Nicht Genügend!&quot;;
}
else if (durchschnitt = '6')
{
	cout &lt;&lt; &quot;Die Arbeit muss auf Grund zu schlechter Leistungen wiederholt werden!&quot;;
}

return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/137557/bedingte-verzweigungen-die-2</link><generator>RSS for Node</generator><lastBuildDate>Sat, 29 Aug 2026 18:39:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/137557.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 18 Feb 2006 15:31:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 15:31:09 GMT]]></title><description><![CDATA[<p>Die Aufgabe geht weiter... Der erste TEil bis zum Ausrechnen des Durchschnitts klappt. Dann soll in Abhängigkeit der Durchschnittsnote die übliche Bezeichnung ausgegeben werden... Aber das Programm gibt immer nur Sehr Gut aus.... Was mach ich falsch???</p>
<p>Schon im voraus Danke!!</p>
<pre><code class="language-cpp">int main ()
{

int notenanzahl=0; 
float summe=0; 
int note = 0; 
float durchschnitt=0; 
do 
{ 
 cout&lt;&lt; &quot;Bitte die Note eingeben: &quot;;
 cin&gt;&gt; note; 

 summe=summe+note; 
 notenanzahl++; 
}
while(note!=0); 
notenanzahl--;   

durchschnitt=summe/notenanzahl; 
cout&lt;&lt; &quot;Die Durchschnittsnote ist: &quot;&lt;&lt; durchschnitt &lt;&lt;endl; 

if (durchschnitt = '1')
{
	cout  &lt;&lt; &quot;Sehr Gut! &quot;;
}

else if (durchschnitt = '2')
{
	cout &lt;&lt; &quot;Gut!&quot;;
}

else if (durchschnitt = '3')
{
	cout &lt;&lt; &quot;Befriedigentd!&quot;;
}
else if (durchschnitt = '4')
{
	cout &lt;&lt; &quot;Genügend!&quot;;
}
else if (durchschnitt = '5')
{
	cout &lt;&lt; &quot;Die Allgemeinen Leistungen sind Nicht Genügend!&quot;;
}
else if (durchschnitt = '6')
{
	cout &lt;&lt; &quot;Die Arbeit muss auf Grund zu schlechter Leistungen wiederholt werden!&quot;;
}

return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/997288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997288</guid><dc:creator><![CDATA[Visual Newbie]]></dc:creator><pubDate>Sat, 18 Feb 2006 15:31:09 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 15:38:46 GMT]]></title><description><![CDATA[<p>[cpp]</p>
<p>if(notenanzahl **==**1) //=ist der zuweisungoperater == hingegen der vergleichs<br />
//operator<br />
{...}<br />
[/cpp]</p>
<p>edit: passt was mit den cpp tags nicht ? o.0</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997291</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Sat, 18 Feb 2006 15:38:46 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 15:37:33 GMT]]></title><description><![CDATA[<p>So sollen wir Bedingte Verzweigungen lernen...Bestimmt geht es einfacher... aber... naja, <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/997296</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997296</guid><dc:creator><![CDATA[Visual Newbie]]></dc:creator><pubDate>Sat, 18 Feb 2006 15:37:33 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 15:39:22 GMT]]></title><description><![CDATA[<p>Wenn ich == mache, Hört er gleich nach Durchschnitt auf und geht gar nicht mehr zu den ifs.....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997299</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997299</guid><dc:creator><![CDATA[Visual Newbie]]></dc:creator><pubDate>Sat, 18 Feb 2006 15:39:22 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 15:42:28 GMT]]></title><description><![CDATA[<p>mach das int notenanzahl mal zu nem float und schau was passiert <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title="=)"
      alt="🙂"
    /></p>
<p>ach ja das fällt mir jetzt erst auf : mach bei den if abfragen die hochkommas weg, damit signalisierst du dem compiler nur, das das ein char sein soll und in der ascii tabelle hat die 1 nicht den wert &quot;1&quot; sondern 97 oder so</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997300</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Sat, 18 Feb 2006 15:42:28 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 15:47:03 GMT]]></title><description><![CDATA[<p>Hochkommas weg, notenanzahl auf float, und trotzdem geht er immer nur bis zu die Durchschnittsnote ist... Wenn ich mit einem = mache, macht das Programm immer Sehr gut <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/997305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997305</guid><dc:creator><![CDATA[Visual Newbie]]></dc:creator><pubDate>Sat, 18 Feb 2006 15:47:03 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 16:15:29 GMT]]></title><description><![CDATA[<p>Du vergleichst nur auf ganze Zahlen. Was ist aber wenn der Durchschnitt z.B. 2.5 ist?<br />
Das passt dann in keine Abfrage rein.</p>
<p>Versuche das mal so:</p>
<pre><code class="language-cpp">if (durchschnitt &gt;= 5.5)
{
    cout &lt;&lt; &quot;Die Arbeit muss auf Grund zu schlechter Leistungen wiederholt werden!&quot;; 
}
else if (durchschnitt &gt;= 4.5)
{
    cout &lt;&lt; &quot;Die Allgemeinen Leistungen sind Nicht Genügend!&quot;;
}
else if (durchschnitt &gt;= 3.5)
{
    cout &lt;&lt; &quot;Genügend!&quot;;
}
else if (durchschnitt &gt;= 2.5)
{
    cout &lt;&lt; &quot;Befriedigentd!&quot;;
}
else if (durchschnitt &gt;= 1.5)
{
    cout &lt;&lt; &quot;Gut!&quot;;
}
else
{
    cout  &lt;&lt; &quot;Sehr Gut! &quot;;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/997310</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997310</guid><dc:creator><![CDATA[C Newbie]]></dc:creator><pubDate>Sat, 18 Feb 2006 16:15:29 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 15:59:36 GMT]]></title><description><![CDATA[<p>Klappt leider auch nicht. Er bleibt immer bei Sehr gut! Muss man da noch Anweisungen dazwischenbauen???<br />
Ist else if denn überhaupt richtig???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997313</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997313</guid><dc:creator><![CDATA[Visual Newbie]]></dc:creator><pubDate>Sat, 18 Feb 2006 15:59:36 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 19:07:16 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;

using namespace std;

int runden(float f) {
  int i = static_cast&lt;int&gt;(f);

  if ((f-i)&gt;=0.5)
    ++i;
  return i;
};

int main() {
  char *noten[] = {&quot;Sehr gut&quot;, &quot;Gut&quot;, &quot;Befriedigend&quot;, &quot;Ausreichend&quot;, &quot;Mangelhaft&quot;, &quot;Ungenuegend&quot;};

  int notenanzahl = -1;  //wegen überflüssiger Eingabe der 0 als Eingabeende gleich eins niedriger gesetzt
  float summe = 0.0;
  float note = 0.0;
  float durchschnitt=0.0;

  do {
    cout &lt;&lt; &quot;Bitte die Note eingeben: &quot;;
    cin &gt;&gt; note;

    summe += note;
    ++notenanzahl;
  } while(note != 0.0);

  durchschnitt = summe/notenanzahl;
  cout&lt;&lt; &quot;Die Durchschnittsnote ist: &quot;&lt;&lt; durchschnitt &lt;&lt;'\n'; 

  cout&lt;&lt; noten[runden(durchschnitt)-1] &lt;&lt;'\n';

  return 0;
};
</code></pre>
<p>Ich hab's jetzt nicht getestet, u.U. sind noch n paar Fehler, hab hier grad keinen Compiler.</p>
<p>EDIT: return 0 vergessen *duck* <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>
<p>MfG</p>
<p>GPC</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997319</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997319</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Sat, 18 Feb 2006 19:07:16 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 16:13:14 GMT]]></title><description><![CDATA[<p>Sorry,</p>
<p>aber für mich als Anfänger ist das zu harter Tobac, dass muss doch ohne static weiß ich was gehen...</p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/997321</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997321</guid><dc:creator><![CDATA[Visual Newbie]]></dc:creator><pubDate>Sat, 18 Feb 2006 16:13:14 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 16:14:37 GMT]]></title><description><![CDATA[<p>static_cast ist einfach ein Cast, der mir in dem Fall den Ganzzahlanteil aus der Gleitkommazahl rauszieht, also aus 4.5 die 4 holt.<br />
Funktioniert meine Lösung eigentlich?</p>
<p>MfG</p>
<p>GPC</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997322</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997322</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Sat, 18 Feb 2006 16:14:37 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 16:17:54 GMT]]></title><description><![CDATA[<p>Ich habe das gerade mal getestet. Die Lösung von GPC und meine jetzige <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="😉"
    /> funktionieren beide.<br />
Editier einfach mal deinen aktuellen Code in den Startpost rein. Damit wir gucken können, was noch falsch ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997326</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997326</guid><dc:creator><![CDATA[C Newbie]]></dc:creator><pubDate>Sat, 18 Feb 2006 16:17:54 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 16:19:27 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">int main ()
{

float notenanzahl=0; 
float summe=0; 
int note = 0; 
float durchschnitt=0; 
do 
{ 
 cout&lt;&lt; &quot;Bitte die Note eingeben: &quot;;
 cin&gt;&gt; note; 

 summe=summe+note; 
 notenanzahl++; 
}
while(note!=0); 
notenanzahl--;   

durchschnitt=summe/notenanzahl; 
cout&lt;&lt; &quot;Die Durchschnittsnote ist: &quot;&lt;&lt; durchschnitt &lt;&lt;endl; 

if (durchschnitt &gt;= 1)
{
	cout  &lt;&lt; &quot;Sehr Gut! &quot;;
}

else if (durchschnitt &gt;= 2)
{
	cout &lt;&lt; &quot;Gut!&quot;;
}

else if (durchschnitt &gt;= 3)
{
	cout &lt;&lt; &quot;Befriedigentd!&quot;;
}
else if (durchschnitt &gt;=4)
{
	cout &lt;&lt; &quot;Genügend!&quot;;
}
else if (durchschnitt &gt;= 5)
{
	cout &lt;&lt; &quot;Die Allgemeinen Leistungen sind Nicht Genügend!&quot;;
}
else if (durchschnitt &gt;= 6)
{
	cout &lt;&lt; &quot;Die Arbeit muss auf Grund zu schlechter Leistungen wiederholt werden!&quot;;
}

return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/997330</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997330</guid><dc:creator><![CDATA[Visual Newbie]]></dc:creator><pubDate>Sat, 18 Feb 2006 16:19:27 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 17:02:57 GMT]]></title><description><![CDATA[<p>Du prüftst ja zuerst, ob der durchschnitt größer als 1 ist. Das ist er aber auch wenn er z.b. 4 ist.<br />
Es wird also immer &quot;sehr gut&quot; ausgegeben...</p>
<p>Schau dir den Post von C Newbie nochmal an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/997361</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997361</guid><dc:creator><![CDATA[michba]]></dc:creator><pubDate>Sat, 18 Feb 2006 17:02:57 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 17:08:29 GMT]]></title><description><![CDATA[<p>Okay, jetzt hats gefunkt....</p>
<p>Danke, ich hab mir den Post von C Newbie zu wenig genau angeguckt...</p>
<p>Jetzt funktioniert es...</p>
<p>Thanks... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/997364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997364</guid><dc:creator><![CDATA[Visual Newbie]]></dc:creator><pubDate>Sat, 18 Feb 2006 17:08:29 GMT</pubDate></item><item><title><![CDATA[Reply to Bedingte Verzweigungen die 2. on Sat, 18 Feb 2006 18:04:56 GMT]]></title><description><![CDATA[<p>edit: verguckt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f623.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--persevering_face"
      title="&gt;.&lt;"
      alt="😣"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/997417</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/997417</guid><dc:creator><![CDATA[life]]></dc:creator><pubDate>Sat, 18 Feb 2006 18:04:56 GMT</pubDate></item></channel></rss>