<?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[Problem mit Mathe Formel]]></title><description><![CDATA[<p>Hallo</p>
<p>Also ich will ein Programm machen das folgendes tut:</p>
<p>Der User gibt ein wie viele Siege er hat und dann gibt das Programm ihm seine</p>
<p>Punkte aus:</p>
<p>Ab 14 Siegen bekommt man 232 Punkte</p>
<p>Ab 15 Siegen bekommt 272 Punkte Punkte</p>
<p>und so weiter dann immer +40</p>
<p>Ab 16 Siegen bekommt man dann 312 Punkte</p>
<p>Weiss einer da zufällig eine Formel für oder so ich bin schon die ganze zeit am probieren aber es klappt nicht <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/topic/194830/problem-mit-mathe-formel</link><generator>RSS for Node</generator><lastBuildDate>Tue, 29 Sep 2026 16:37:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/194830.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Oct 2007 11:10:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit Mathe Formel on Thu, 11 Oct 2007 11:10:35 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Also ich will ein Programm machen das folgendes tut:</p>
<p>Der User gibt ein wie viele Siege er hat und dann gibt das Programm ihm seine</p>
<p>Punkte aus:</p>
<p>Ab 14 Siegen bekommt man 232 Punkte</p>
<p>Ab 15 Siegen bekommt 272 Punkte Punkte</p>
<p>und so weiter dann immer +40</p>
<p>Ab 16 Siegen bekommt man dann 312 Punkte</p>
<p>Weiss einer da zufällig eine Formel für oder so ich bin schon die ganze zeit am probieren aber es klappt nicht <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/1382749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1382749</guid><dc:creator><![CDATA[Bassmaster]]></dc:creator><pubDate>Thu, 11 Oct 2007 11:10:35 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Mathe Formel on Thu, 11 Oct 2007 11:18:44 GMT]]></title><description><![CDATA[<p>Habe ich ein Deja vu?</p>
<pre><code class="language-cpp">int CalculatePoints (int iWin)
{
    if (iWin &lt; 14)
        return 0;

    return ((iWin - 14) * 40) + 232;
}
</code></pre>
<p>kA ob das so geht, nicht getestet</p>
<p>EDIT: bei sowas gibt es keine Pauschalformel. Du musst für jedes Problem eine passende Formel entwickeln.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1382755</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1382755</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Thu, 11 Oct 2007 11:18:44 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Mathe Formel on Thu, 11 Oct 2007 11:20:18 GMT]]></title><description><![CDATA[<p>Jo es geht thx <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1382761</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1382761</guid><dc:creator><![CDATA[Bassmaster]]></dc:creator><pubDate>Thu, 11 Oct 2007 11:20:18 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Mathe Formel on Thu, 11 Oct 2007 11:45:02 GMT]]></title><description><![CDATA[<p>Herangehensweise an das eigentlich simple Problem:</p>
<p>Gegeben sind die Punkte ab einer bestimmten Zahl Siege (hier 14). Ab dem 14. Sieg, welcher 232 Punkte gibt, erhält man für jeden weiteren Sieg 40 Punkte.</p>
<pre><code>Siege          | Punkte
---------------+----------------
0 - 13         | nicht definiert
14             | 232(+  0 = 232)
15             | 232 + 40 = 272
16             | 272 + 40 = 312
17             | 312 + 40 = 352
...            | ...
</code></pre>
<p>Die Punkte nehmen (ab Sieg 14) linear zu. Es handelt sich folglich um eine (einfache) lineare Gleichung der Form <em>y = ax + b</em>.</p>
<p>y ^= Punktzahl<br />
a ^= Punktezunahme (40)<br />
x ^= Zahl der Siege ab dem 14. Sieg (Zahl der Siege minus 14)<br />
b ^= Anzahl Punkte ab dem 14. Sieg (232)</p>
<p>a und b sind bekannt und können daher eingesetzt werden:</p>
<p>y = 40 * (Siege - 14) + 232</p>
<p>Wobei 'Siege' größer oder gleich 14 sein muss, da die Lösung für den Bereich 0 bis 13 nicht definiert ist.</p>
<p>Es ergibt sich demnach folgende Funktion (mit Hilfsvariablen zu Verdeutlichung):</p>
<pre><code class="language-cpp">int punkte(int siege)
    {
        int y; // Rückgabewert
        int x = siege - 14;
        int a = 40;
        int b = 232;

        y = a*x + b;

        return y;
}
</code></pre>
<p>Für die Bereichsprüfung von 'siege' empfiehlt es sich, eine Ausnahme zu werfen und nicht den Wert 0 zurück zu geben. Anders natürlich, wenn es bis einschließlich 13 Siegen null Punkte gibt.</p>
<p>Grüße...</p>
<p>Heiko</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1382775</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1382775</guid><dc:creator><![CDATA[bwbg]]></dc:creator><pubDate>Thu, 11 Oct 2007 11:45:02 GMT</pubDate></item></channel></rss>