<?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[Eisautomat]]></title><description><![CDATA[<p>Hallo hat jemand einen Quellcode für mich für einen Eisautomat???<br />
er sollte objektorientiert sein...... DANKE <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/topic/185129/eisautomat</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 03:06:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/185129.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Jun 2007 08:09:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 08:09:17 GMT]]></title><description><![CDATA[<p>Hallo hat jemand einen Quellcode für mich für einen Eisautomat???<br />
er sollte objektorientiert sein...... DANKE <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/1311209</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311209</guid><dc:creator><![CDATA[berger710]]></dc:creator><pubDate>Fri, 22 Jun 2007 08:09:17 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 08:13:57 GMT]]></title><description><![CDATA[<p>noch sahne oben drauf?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311213</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311213</guid><dc:creator><![CDATA[thordk]]></dc:creator><pubDate>Fri, 22 Jun 2007 08:13:57 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 08:14:35 GMT]]></title><description><![CDATA[<p>sei doch nicht so böse bitte <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/1311214</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311214</guid><dc:creator><![CDATA[berger710]]></dc:creator><pubDate>Fri, 22 Jun 2007 08:14:35 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 08:18:01 GMT]]></title><description><![CDATA[<p>Ich habe hier eine Quellcode vom eisautomat, er ist aber nich objektorientiert weil ich nicht genau weiß wie das funtioniert.<br />
kann mir bitte jemand helfen??</p>
<p>/---------------------------------------------------------------------------<br />
#include &lt;iostream&gt;<br />
#include &lt;string&gt;<br />
using namespace std;</p>
<p>//---------------------------------------------------------------------------</p>
<p>int main()<br />
{<br />
int muenzen; //Anzahl eingeworfener Münzen<br />
int betrag=0; //Eingeworfener Geldbetrag<br />
int wechselgeld; //Betrag, der vom Automat insgesamt ausbezahlt werden muss<br />
int rest; // noch auszubezahlender Betrag<br />
int sorte; //Eissorte<br />
int nochmal; //Verkaufsautomat beenden?<br />
bool passend;<br />
float preise[]={99, 120, 543, 188, 64}; //Preise der Eissorten<br />
string produkte[]={&quot;Magnum&quot;, &quot;Magnum Deluxe&quot;, &quot;Schokobaer&quot;, &quot;Marzipaneis&quot;, &quot;Eiskonfekt&quot;};<br />
int wert[]={1,2,5,10,20,50,100,200}; //Muenzgeldwerte<br />
int schacht[]={2,2,2,2,2,2,2,2}; //Anzahl Muenzen pro Schacht<br />
string name[]={&quot;1 Cent&quot;, &quot;2 Cent&quot;, &quot;5 Cent&quot;, &quot;10 Cent&quot;, &quot;20 Cent&quot;, &quot;50 Cent&quot;, &quot;1 Euro&quot;, &quot;2 Euro&quot;};<br />
do{<br />
int i=4;<br />
int einwurf[]={0,0,0,0,0,0,0,0}; //aktueller Münzeinwurf pro Verkaufsvorgang<br />
betrag=0;<br />
cout&lt;&lt;&quot;Unser Eisangebot:\n&quot;;<br />
while (i&gt;=0) { //Ausgabe der Eisssorten mit Preis<br />
cout&lt;&lt;produkte[i] &lt;&lt;&quot;: &quot;&lt;&lt;preise[i]&lt;&lt;&quot; Cent (&quot;&lt;&lt;i&lt;&lt;&quot;)\n&quot;;<br />
i--;<br />
}</p>
<p>cout&lt;&lt;&quot;\nBitte werfen Sie Muenzen ein.\n&quot;;<br />
for (i=7; i&gt;=0; i--) { //Münzeinwurf<br />
cout&lt;&lt;&quot;Wieviele &quot; &lt;&lt;name[i]&lt;&lt;&quot;-Muenzen werfen Sie ein?&quot;;<br />
cin&gt;&gt;einwurf[i];<br />
schacht[i]=schacht[i]+einwurf[i];<br />
betrag=betrag + einwurf[i]*wert[i];<br />
}<br />
for (i=7; i&gt;=0; i--) { //Ausgabe der Münzen pro Schacht<br />
cout&lt;&lt;&quot;\nNoch &quot;&lt;&lt;schacht[i]&lt;&lt; &quot; &quot; &lt;&lt;name[i]&lt;&lt;&quot; Muenzen als Wechselgeld vorhanden&quot;;<br />
}</p>
<p>cout&lt;&lt;&quot;\n\nSie haben &quot;&lt;&lt;betrag&lt;&lt;&quot; Cent eingeworfen\n\n&quot;;<br />
getchar();<br />
cout&lt;&lt;&quot;Waehlen sie ihr Produkt durch Eingabe der in Klammern stehenden Zahl: &quot;;<br />
cin &gt;&gt;sorte;<br />
cout&lt;&lt;&quot;Ihre Wahl: &quot;&lt;&lt;produkte[sorte]&lt;&lt;endl;<br />
getchar();<br />
if (preise[sorte]&lt;=betrag) { //eingeworfener Geldbetrag passt<br />
cout&lt;&lt;&quot;\nEingeworfener Betrag in Ordnung&quot;;<br />
passend = 1;<br />
wechselgeld = betrag-preise[sorte];<br />
rest=wechselgeld;<br />
cout&lt;&lt;&quot;\nIhr Produkt: &quot;&lt;&lt;produkte[sorte] &lt;&lt;&quot; kostet &quot;&lt;&lt;preise[sorte]&lt;&lt;&quot; Cent&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;Sie bekommen folgenden Wechselbetrag: &quot;&lt;&lt;wechselgeld&lt;&lt;&quot; Cent&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;Hier noch in Muenzen: &quot;&lt;&lt;endl;<br />
for (i=7; i&gt;=0; i--) { //Berechnung Wechselgeld<br />
muenzen=rest/wert[i];<br />
if (schacht[i]&gt;= muenzen) {<br />
rest=rest%wert[i];<br />
schacht[i]-=muenzen;<br />
cout&lt;&lt;name[i]&lt;&lt;&quot; : &quot;&lt;&lt;muenzen&lt;&lt;endl;<br />
}<br />
}<br />
for (i=7; i&gt;=0; i--) { //Ausgabe der Münzen pro Schacht<br />
cout&lt;&lt;&quot;\nNoch &quot;&lt;&lt;schacht[i]&lt;&lt; &quot; &quot; &lt;&lt;name[i]&lt;&lt;&quot; Muenzen als Wechselgeld vorhanden&quot;;<br />
}<br />
if (rest != 0) { //zuwenig Wechselgeld<br />
cout&lt;&lt;endl&lt;&lt;&quot;<em><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong>&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;Wechselgeld nicht ausreichend! Betrag bitte passend eingeben!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;</strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></em>&quot;&lt;&lt;endl;<br />
passend = 0;<br />
}</p>
<p>}<br />
else { //zuwenig Geld eingeworfen<br />
cout&lt;&lt;endl&lt;&lt;&quot;<em><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong>&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;Betrag nicht in Ordnung.&quot;&lt;&lt;endl&lt;&lt;&quot;Es fehlen noch &quot;&lt;&lt;preise[sorte]-betrag&lt;&lt;&quot; Cent&quot;&lt;&lt;endl;<br />
cout&lt;&lt;endl&lt;&lt;&quot;</strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></em>&quot;&lt;&lt;endl;<br />
passend = 0;<br />
}</p>
<p>if (!passend) { //Rückagbe der eingeworfenenen Münzen, da Verkauf nciht erfolgreich<br />
cout &lt;&lt;&quot;Sie erhalten nun ihr eingeworfenes Geld zurueck&quot;&lt;&lt;endl;<br />
for (i=7;i&gt;=0; i--) {<br />
schacht[i]-=einwurf[i];<br />
}<br />
}</p>
<p>cout&lt;&lt;endl&lt;&lt;endl&lt;&lt;&quot;Nochmal? Geben Sie die 1 ein:&quot;; //Abfrage, ob nochmal verkauft werden soll<br />
cin&gt;&gt;nochmal;<br />
cout&lt;&lt;&quot;\n&quot;;</p>
<p>}while (nochmal==1);<br />
getchar();<br />
return 0;<br />
}<br />
//---------------------------------------------------------------------------</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311219</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311219</guid><dc:creator><![CDATA[berger710]]></dc:creator><pubDate>Fri, 22 Jun 2007 08:18:01 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 08:28:26 GMT]]></title><description><![CDATA[<p>Bitte... ^^</p>
<pre><code class="language-cpp">class Eisautomat{

Eisautomat(){
nt muenzen; //Anzahl eingeworfener Münzen 
int betrag=0; //Eingeworfener Geldbetrag 
int wechselgeld; //Betrag, der vom Automat insgesamt ausbezahlt werden muss 
int rest; // noch auszubezahlender Betrag 
int sorte; //Eissorte 
int nochmal; //Verkaufsautomat beenden? 
bool passend; 
float preise[]={99, 120, 543, 188, 64}; //Preise der Eissorten 
string produkte[]={&quot;Magnum&quot;, &quot;Magnum Deluxe&quot;, &quot;Schokobaer&quot;, &quot;Marzipaneis&quot;, &quot;Eiskonfekt&quot;}; 
int wert[]={1,2,5,10,20,50,100,200}; //Muenzgeldwerte 
int schacht[]={2,2,2,2,2,2,2,2}; //Anzahl Muenzen pro Schacht 
string name[]={&quot;1 Cent&quot;, &quot;2 Cent&quot;, &quot;5 Cent&quot;, &quot;10 Cent&quot;, &quot;20 Cent&quot;, &quot;50 Cent&quot;, &quot;1 Euro&quot;, &quot;2 Euro&quot;}; 
do{ 
int i=4; 
int einwurf[]={0,0,0,0,0,0,0,0}; //aktueller Münzeinwurf pro Verkaufsvorgang 
betrag=0; 
cout&lt;&lt;&quot;Unser Eisangebot:\n&quot;; 
while (i&gt;=0) { //Ausgabe der Eisssorten mit Preis 
cout&lt;&lt;produkte[i] &lt;&lt;&quot;: &quot;&lt;&lt;preise[i]&lt;&lt;&quot; Cent (&quot;&lt;&lt;i&lt;&lt;&quot;)\n&quot;; 
i--; 
} 

cout&lt;&lt;&quot;\nBitte werfen Sie Muenzen ein.\n&quot;; 
for (i=7; i&gt;=0; i--) { //Münzeinwurf 
cout&lt;&lt;&quot;Wieviele &quot; &lt;&lt;name[i]&lt;&lt;&quot;-Muenzen werfen Sie ein?&quot;; 
cin&gt;&gt;einwurf[i]; 
schacht[i]=schacht[i]+einwurf[i]; 
betrag=betrag + einwurf[i]*wert[i]; 
} 
for (i=7; i&gt;=0; i--) { //Ausgabe der Münzen pro Schacht 
cout&lt;&lt;&quot;\nNoch &quot;&lt;&lt;schacht[i]&lt;&lt; &quot; &quot; &lt;&lt;name[i]&lt;&lt;&quot; Muenzen als Wechselgeld vorhanden&quot;; 
} 

cout&lt;&lt;&quot;\n\nSie haben &quot;&lt;&lt;betrag&lt;&lt;&quot; Cent eingeworfen\n\n&quot;; 
getchar(); 
cout&lt;&lt;&quot;Waehlen sie ihr Produkt durch Eingabe der in Klammern stehenden Zahl: &quot;; 
cin &gt;&gt;sorte; 
cout&lt;&lt;&quot;Ihre Wahl: &quot;&lt;&lt;produkte[sorte]&lt;&lt;endl; 
getchar(); 
if (preise[sorte]&lt;=betrag) { //eingeworfener Geldbetrag passt 
cout&lt;&lt;&quot;\nEingeworfener Betrag in Ordnung&quot;; 
passend = 1; 
wechselgeld = betrag-preise[sorte]; 
rest=wechselgeld; 
cout&lt;&lt;&quot;\nIhr Produkt: &quot;&lt;&lt;produkte[sorte] &lt;&lt;&quot; kostet &quot;&lt;&lt;preise[sorte]&lt;&lt;&quot; Cent&quot;&lt;&lt;endl; 
cout&lt;&lt;&quot;Sie bekommen folgenden Wechselbetrag: &quot;&lt;&lt;wechselgeld&lt;&lt;&quot; Cent&quot;&lt;&lt;endl; 
cout&lt;&lt;&quot;Hier noch in Muenzen: &quot;&lt;&lt;endl; 
for (i=7; i&gt;=0; i--) { //Berechnung Wechselgeld 
muenzen=rest/wert[i]; 
if (schacht[i]&gt;= muenzen) { 
rest=rest%wert[i]; 
schacht[i]-=muenzen; 
cout&lt;&lt;name[i]&lt;&lt;&quot; : &quot;&lt;&lt;muenzen&lt;&lt;endl; 
} 
} 
for (i=7; i&gt;=0; i--) { //Ausgabe der Münzen pro Schacht 
cout&lt;&lt;&quot;\nNoch &quot;&lt;&lt;schacht[i]&lt;&lt; &quot; &quot; &lt;&lt;name[i]&lt;&lt;&quot; Muenzen als Wechselgeld vorhanden&quot;; 
} 
if (rest != 0) { //zuwenig Wechselgeld 
cout&lt;&lt;endl&lt;&lt;&quot;***********************************************************************&quot;&lt;&lt;endl; 
cout&lt;&lt;&quot;Wechselgeld nicht ausreichend! Betrag bitte passend eingeben!&quot;&lt;&lt;endl; 
cout&lt;&lt;&quot;***********************************************************************&quot;&lt;&lt;endl; 
passend = 0; 
} 

} 
else { //zuwenig Geld eingeworfen 
cout&lt;&lt;endl&lt;&lt;&quot;***********************************************************************&quot;&lt;&lt;endl; 
cout&lt;&lt;&quot;Betrag nicht in Ordnung.&quot;&lt;&lt;endl&lt;&lt;&quot;Es fehlen noch &quot;&lt;&lt;preise[sorte]-betrag&lt;&lt;&quot; Cent&quot;&lt;&lt;endl; 
cout&lt;&lt;endl&lt;&lt;&quot;***********************************************************************&quot;&lt;&lt;endl; 
passend = 0; 
} 

if (!passend) { //Rückagbe der eingeworfenenen Münzen, da Verkauf nciht erfolgreich 
cout &lt;&lt;&quot;Sie erhalten nun ihr eingeworfenes Geld zurueck&quot;&lt;&lt;endl; 
for (i=7;i&gt;=0; i--) { 
schacht[i]-=einwurf[i]; 
} 
} 

cout&lt;&lt;endl&lt;&lt;endl&lt;&lt;&quot;Nochmal? Geben Sie die 1 ein:&quot;; //Abfrage, ob nochmal verkauft werden soll 
cin&gt;&gt;nochmal; 
cout&lt;&lt;&quot;\n&quot;; 

}while (nochmal==1); 
getchar(); 
return 0; 
} 
}
~Eisautomat(){}

};

int main(void){

Eisautomat o;

return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1311224</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311224</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Fri, 22 Jun 2007 08:28:26 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 08:41:39 GMT]]></title><description><![CDATA[<p>Sehr Freundlich danke aber irgendwie funktioniert es nicht richtig <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/1311232</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311232</guid><dc:creator><![CDATA[berger710]]></dc:creator><pubDate>Fri, 22 Jun 2007 08:41:39 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 08:51:51 GMT]]></title><description><![CDATA[<p>das ist ein Problem, das du selbst zu lösen hast, wenn du probleme mit objektorientiertheit hat, dann kauf diern buch, oder lass dir den stoff von irgendeinem Lehrer oder Dozenten erklären. Aber das dir irgendwer hier deine Aufgaben macht, während du selbst überhaupt kein interesse daran Zeigst, das selbt hinzubekommen, kansst du vergessen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311246</guid><dc:creator><![CDATA[Krux]]></dc:creator><pubDate>Fri, 22 Jun 2007 08:51:51 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 08:55:06 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/11517">@Krux</a>: <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/27a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--right_arrow"
      title=":arrow_right:"
      alt="➡"
    /> Absolut!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311247</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311247</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Fri, 22 Jun 2007 08:55:06 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 08:55:44 GMT]]></title><description><![CDATA[<p>naja gut ok danke trotzdem</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311249</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311249</guid><dc:creator><![CDATA[berger710]]></dc:creator><pubDate>Fri, 22 Jun 2007 08:55:44 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 09:34:05 GMT]]></title><description><![CDATA[<p>für 50Euro, kein Thema....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311284</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311284</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Fri, 22 Jun 2007 09:34:05 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 11:15:33 GMT]]></title><description><![CDATA[<p>Wie Krux schon sagte, ist es wichtig, dass du dir selbst überlegst, welche Klassen praktisch wären und wie ihre Objekte zusammen arbeiten könnten.<br />
Hier ist dennoch ein kleiner Vorschlag für einen Anfang:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
using namespace std;

class Eis
{
    string m_sorte;
    double m_preis;

public:

    Eis(const string &amp;sorte, double preis)
        : m_sorte(sorte), m_preis(preis)
    {
    }

    string sorte() const
    {
        return m_sorte;
    }

    double preis() const
    {
        return m_preis;
    }
};

ostream &amp;operator&lt;&lt;(ostream &amp;ausgabestrom, const Eis &amp;e)
{
    return ausgabestrom &lt;&lt; e.sorte() &lt;&lt; &quot;: &quot; &lt;&lt; setw(20 - e.sorte().size()) &lt;&lt; setprecision(2) &lt;&lt; setiosflags(ios::fixed) &lt;&lt; e.preis() &lt;&lt; &quot; Euro\n&quot;;
}

class Eisautomat
{
    vector&lt;Eis*&gt; m_eis;

public:

	Eisautomat()
	{
	    eisEinfuegen(&quot;Magnum&quot;, .99);
	    eisEinfuegen(&quot;Magnum Deluxe&quot;, 1.2);
	    eisEinfuegen(&quot;Schoko Baer&quot;, 5.43);
	    eisEinfuegen(&quot;Marzipaneis&quot;, 1.88);
	    eisEinfuegen(&quot;Eiskonfekt&quot;, .64);
	}

	~Eisautomat()
	{
	    //Eis Objekte entsorgen
	    for(vector&lt;Eis*&gt;::iterator eis = m_eis.begin(); eis != m_eis.end(); ++eis)
            delete (*eis);
	}

	void eisEinfuegen(const string &amp;sorte, double preis)
	{
	    m_eis.push_back(new Eis(sorte, preis));
	}

	void praesentiereAngebot() const
	{
	    cout &lt;&lt; &quot;========================================\n&quot;;
	    cout &lt;&lt; &quot;Unser Eisangebot\n\n&quot;;
	    for (vector&lt;Eis*&gt;::const_iterator eis = m_eis.begin(); eis != m_eis.end(); ++eis)
	    	cout &lt;&lt; (**eis);
        cout &lt;&lt; &quot;========================================&quot;;
	}
};

int main()
{
	Eisautomat a;
	a.eisEinfuegen(&quot;Flutschfinger&quot;, 1.5);
	a.praesentiereAngebot();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1311366</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311366</guid><dc:creator><![CDATA[kleiner anfang]]></dc:creator><pubDate>Fri, 22 Jun 2007 11:15:33 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 12:04:21 GMT]]></title><description><![CDATA[<p>es soll ja offensichtlich objekt orientiert sein, also würd ich in der hinsicht noch mehr objektorientiertheit nutzen, polymorphie und so. auch wenns bisschen überflüssig erscheint, es soll ja was beibringen.</p>
<pre><code class="language-cpp">enum Sorte {
 MAGNUM, FLUTSCHFINGER, ... ;
};

class Eis {
 int preis;
 Sorte sorte;
 std::string name;

 public:
 Sorte getSorte();
 virtual std::string getName() = 0;
};

class Magnum : public Eis {
};

... // noch mehr sorten

class Fach {
 std::vector&lt;Eis*&gt; inhalt;

 public:
 int getAnzahl();
 void removeEis();
};

class Eisautomat {
 std::vector&lt;Fach&gt; sorten;

 public:
 std::vector&lt;Sorten&gt; getSorten();
 void removeEis(Sorte sorte);
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1311406</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311406</guid><dc:creator><![CDATA[thordk]]></dc:creator><pubDate>Fri, 22 Jun 2007 12:04:21 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 12:07:40 GMT]]></title><description><![CDATA[<p>Was fürn Quatsch für jede Sorte ne Klasse ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311410</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311410</guid><dc:creator><![CDATA[oop]]></dc:creator><pubDate>Fri, 22 Jun 2007 12:07:40 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 12:10:31 GMT]]></title><description><![CDATA[<p>oop schrieb:</p>
<blockquote>
<p>Was fürn Quatsch für jede Sorte ne Klasse ...</p>
</blockquote>
<p>troll?</p>
<p>beispielprogramme sollen viele beispiele abgreifen. nen &quot;eisautomat&quot; ist nen 2 zeiler. aber halt nicht, wenns was beibringen soll.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311414</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311414</guid><dc:creator><![CDATA[thordk]]></dc:creator><pubDate>Fri, 22 Jun 2007 12:10:31 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 12:11:54 GMT]]></title><description><![CDATA[<p>das einzige was quatsch ist ist deine Aussage</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311418</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311418</guid><dc:creator><![CDATA[@oop]]></dc:creator><pubDate>Fri, 22 Jun 2007 12:11:54 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 12:12:14 GMT]]></title><description><![CDATA[<p>Troll ?</p>
<p>Und welchen Sinn macht es für jede Eissorte ne Klasse abzuleiten ?<br />
Beispiel hin und her ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311419</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311419</guid><dc:creator><![CDATA[oop]]></dc:creator><pubDate>Fri, 22 Jun 2007 12:12:14 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 12:17:44 GMT]]></title><description><![CDATA[<p>oop schrieb:</p>
<blockquote>
<p>Und welchen Sinn macht es für jede Eissorte ne Klasse abzuleiten ?</p>
</blockquote>
<p>Damit man in jedem Eis die passende Geschmacksrichtung implementieren kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311428</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311428</guid><dc:creator><![CDATA[vollDerOOPler]]></dc:creator><pubDate>Fri, 22 Jun 2007 12:17:44 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 12:22:33 GMT]]></title><description><![CDATA[<p>Lol<br />
Hat nicht jedes Eis nen anderen Geschmack ... ??? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311434</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311434</guid><dc:creator><![CDATA[oop]]></dc:creator><pubDate>Fri, 22 Jun 2007 12:22:33 GMT</pubDate></item><item><title><![CDATA[Reply to Eisautomat on Fri, 22 Jun 2007 12:32:39 GMT]]></title><description><![CDATA[<p>oop schrieb:</p>
<blockquote>
<p>Lol<br />
Hat nicht jedes Eis nen anderen Geschmack ... ??? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
</blockquote>
<p>Ein Eis hat ja nicht ein &quot;Magnumgeschmack&quot;, sondern es gibt Krischgemack, Orange, usw. oder auch cremig, erfrischend... aber ist doch jetzt eh wurscht...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1311448</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1311448</guid><dc:creator><![CDATA[plizer]]></dc:creator><pubDate>Fri, 22 Jun 2007 12:32:39 GMT</pubDate></item></channel></rss>