<?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[Konto-Programm mit C++ (Objektorientiertes Programmieren)]]></title><description><![CDATA[<p>Hallo</p>
<p>ich muß ein Programm schreiben mit dem ich ein Konto &quot;verwalten&quot; kann.<br />
Es soll den Kontostand und Ein und Auszahlungen können.</p>
<p>Bis hier hab ich es schon mal gemacht</p>
<pre><code class="language-cpp">#include&lt;iostream.h&gt;

class konto

	{
		private:
		float kontostand();

		public:
		void einzahlen (float betrag);
		void auszahlen (float betrag);
		void ausgabe (float kontostand);
	};

void konto::einzahlen(float betrag)

	{
		kontostand=kontostand + betrag;
	}

void konto::auszahlen(float betrag)

	{
		if(kontostand&gt;betrag)
		{
			kontostand=kontostand-betrag;
		}

		else

		{
		cout&lt;&lt;&quot;Leider ist die Auszahlung von&quot;&lt;&lt;betrag&lt;&lt;&quot;EUR nicht möglich&quot;&lt;&lt;endl;

		}

		void konto::ausgabe()

		{
			cout&lt;&lt;ausgabe()&lt;&lt;endl;

		}

	}

void main()

	{
		konto k;

		k.kontostand(1000);
		k.einzahlen(1000.67);
		k.auszahlen(154.87);

	}
</code></pre>
<p>Mein Compiler gibt mir dann das aus</p>
<blockquote>
<p>--------------------Konfiguration: konto - Win32 Debug--------------------<br />
Kompilierung läuft...<br />
konto.cpp<br />
konto.cpp(18) : error C2296: '+' : Ungültig, da der linke Operand vom Typ 'float (__thiscall konto::<em>)(void)' ist<br />
konto.cpp(24) : error C2296: '&gt;' : Ungültig, da der linke Operand vom Typ 'float (__thiscall konto::</em>)(void)' ist<br />
konto.cpp(26) : error C2296: '-' : Ungültig, da der linke Operand vom Typ 'float (__thiscall konto::*)(void)' ist<br />
konto.cpp(41) : fatal error C1903: Weiterverarbeitung nach vorhergehendem Fehler nicht moeglich; Kompilierung wird abgebrochen.<br />
Fehler beim Ausführen von cl.exe.</p>
<p>konto.exe - 4 Fehler, 0 Warnung(en)</p>
</blockquote>
<p>Kann mir jemand sagen was das bedeutet und wie ich das beheben kann?</p>
<p>Danke im voraus</p>
<p>Otze2000</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/185300/konto-programm-mit-c-objektorientiertes-programmieren</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 04:41:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/185300.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 23 Jun 2007 19:50:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Sun, 24 Jun 2007 14:47:22 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>ich muß ein Programm schreiben mit dem ich ein Konto &quot;verwalten&quot; kann.<br />
Es soll den Kontostand und Ein und Auszahlungen können.</p>
<p>Bis hier hab ich es schon mal gemacht</p>
<pre><code class="language-cpp">#include&lt;iostream.h&gt;

class konto

	{
		private:
		float kontostand();

		public:
		void einzahlen (float betrag);
		void auszahlen (float betrag);
		void ausgabe (float kontostand);
	};

void konto::einzahlen(float betrag)

	{
		kontostand=kontostand + betrag;
	}

void konto::auszahlen(float betrag)

	{
		if(kontostand&gt;betrag)
		{
			kontostand=kontostand-betrag;
		}

		else

		{
		cout&lt;&lt;&quot;Leider ist die Auszahlung von&quot;&lt;&lt;betrag&lt;&lt;&quot;EUR nicht möglich&quot;&lt;&lt;endl;

		}

		void konto::ausgabe()

		{
			cout&lt;&lt;ausgabe()&lt;&lt;endl;

		}

	}

void main()

	{
		konto k;

		k.kontostand(1000);
		k.einzahlen(1000.67);
		k.auszahlen(154.87);

	}
</code></pre>
<p>Mein Compiler gibt mir dann das aus</p>
<blockquote>
<p>--------------------Konfiguration: konto - Win32 Debug--------------------<br />
Kompilierung läuft...<br />
konto.cpp<br />
konto.cpp(18) : error C2296: '+' : Ungültig, da der linke Operand vom Typ 'float (__thiscall konto::<em>)(void)' ist<br />
konto.cpp(24) : error C2296: '&gt;' : Ungültig, da der linke Operand vom Typ 'float (__thiscall konto::</em>)(void)' ist<br />
konto.cpp(26) : error C2296: '-' : Ungültig, da der linke Operand vom Typ 'float (__thiscall konto::*)(void)' ist<br />
konto.cpp(41) : fatal error C1903: Weiterverarbeitung nach vorhergehendem Fehler nicht moeglich; Kompilierung wird abgebrochen.<br />
Fehler beim Ausführen von cl.exe.</p>
<p>konto.exe - 4 Fehler, 0 Warnung(en)</p>
</blockquote>
<p>Kann mir jemand sagen was das bedeutet und wie ich das beheben kann?</p>
<p>Danke im voraus</p>
<p>Otze2000</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1312395</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1312395</guid><dc:creator><![CDATA[otze2000]]></dc:creator><pubDate>Sun, 24 Jun 2007 14:47:22 GMT</pubDate></item><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Sat, 23 Jun 2007 23:58:43 GMT]]></title><description><![CDATA[<p>Nach schnellen durchschauen würde ich sagen, entferne die klammern bei</p>
<pre><code class="language-cpp">float kontostand();
</code></pre>
<p>denn so wie du das deklariert hast, ist es eine Funktion, und keine Variable die du sicherlich wolltest.</p>
<p>Gruß Matthias</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1312524</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1312524</guid><dc:creator><![CDATA[CTecS]]></dc:creator><pubDate>Sat, 23 Jun 2007 23:58:43 GMT</pubDate></item><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Sun, 24 Jun 2007 08:05:45 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-9713.html" rel="nofollow">estartu</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-1.html" rel="nofollow">MFC (Visual C++)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1312578</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1312578</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sun, 24 Jun 2007 08:05:45 GMT</pubDate></item><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Sun, 24 Jun 2007 09:15:28 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>und danke für die Antwort.</p>
<p>Macht auf jeden Fall sinn aber manchmal sieht man es einfach nicht.</p>
<p>Nun bekomme ich einen neuen Fehler.</p>
<blockquote>
<p>:\C++ übungen\aufgabe7\7aufgabe.cpp(41) : fatal error C1001: INTERNER COMPILER- FEHLER (Compiler-Datei &quot;msc1.cpp&quot;, Zeile 1794)</p>
</blockquote>
<p>Woran kann das liegen?<br />
Hoffe auf neue hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1312610</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1312610</guid><dc:creator><![CDATA[otze2000]]></dc:creator><pubDate>Sun, 24 Jun 2007 09:15:28 GMT</pubDate></item><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Sun, 24 Jun 2007 14:22:52 GMT]]></title><description><![CDATA[<p>Also äääh bei deinem Programm sehe ich einige Fehler Oo</p>
<p>Zuerst mal der Header:</p>
<pre><code class="language-cpp">//#include &lt;iostream.h&gt;  //veraltet

#include&lt;iostream&gt; //Schon besser
using namespace std;
</code></pre>
<p>Dann versuchst du auf konto::kontostand zuzugreifen, was aber 1. privat und 2. nicht deiniert ist.</p>
<p>3.:</p>
<pre><code class="language-cpp">void konto::ausgabe()
{
	cout &lt;&lt; ausgabe() &lt;&lt; endl; //WTF?
}
</code></pre>
<p>Hier versucht die Funktion sich selber auszugeben, aber sie ist void, das ergibt einen Fehler.</p>
<p>Dann hast du noch eine geschweifte Klammer falsch gesetzt:</p>
<pre><code class="language-cpp">void konto::auszahlen(float betrag)
{
	if(kontostand &gt; betrag)
	{
		kontostand = kontostand-betrag;
	}
	else
	{
		cout &lt;&lt; &quot;Leider ist die Auszahlung von&quot; &lt;&lt; betrag&lt; &lt;&quot;EUR nicht möglich&quot; &lt;&lt; endl;
	}

void konto::ausgabe()
{
	cout &lt;&lt; ausgabe() &lt;&lt; endl; //WTF?
}
}
</code></pre>
<p>Wird zu:</p>
<pre><code class="language-cpp">void konto::auszahlen(float betrag)
{
	if(kontostand &gt; betrag)
	{
		kontostand = kontostand-betrag;
	}
	else
	{
		cout &lt;&lt; &quot;Leider ist die Auszahlung von&quot; &lt;&lt; betrag&lt; &lt;&quot;EUR nicht möglich&quot; &lt;&lt; endl;
	}
}

void konto::ausgabe()
{
	cout &lt;&lt; ausgabe() &lt;&lt; endl; //WTF?
}
</code></pre>
<p>Und bitte bitte bitte gewöhne dir eine vernünftige Einrückung deines Codes an, das von dir da oben ist echt unmöglich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1312749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1312749</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Sun, 24 Jun 2007 14:22:52 GMT</pubDate></item><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Mon, 25 Jun 2007 04:04:03 GMT]]></title><description><![CDATA[<p>die konto geschichten erinnern mich schwer ans erste Semester <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/1313065</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1313065</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Mon, 25 Jun 2007 04:04:03 GMT</pubDate></item><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Mon, 25 Jun 2007 04:59:12 GMT]]></title><description><![CDATA[<p>Wirtschaftsinformatiker oder was?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1313068</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1313068</guid><dc:creator><![CDATA[V2.0]]></dc:creator><pubDate>Mon, 25 Jun 2007 04:59:12 GMT</pubDate></item><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Mon, 25 Jun 2007 05:12:06 GMT]]></title><description><![CDATA[<p>ne Medien-Informatiker...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1313076</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1313076</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Mon, 25 Jun 2007 05:12:06 GMT</pubDate></item><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Tue, 26 Jun 2007 18:31:37 GMT]]></title><description><![CDATA[<p>Hallo und danke für die Hilfe.</p>
<p>Hab es mit Eurer hilfe hinbekommen.<br />
Ach ja es ist weder wirtschaft noch Medieninformatik.<br />
Es ist ganz normaler Maschinenbau;-)</p>
<p>Also Danke nochmal</p>
<p>Markus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1314246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1314246</guid><dc:creator><![CDATA[otze2000]]></dc:creator><pubDate>Tue, 26 Jun 2007 18:31:37 GMT</pubDate></item><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Tue, 26 Jun 2007 18:38:35 GMT]]></title><description><![CDATA[<p>Tip: für Geldbeträge grundsätzlich *niemals* float oder double verwenden. IMMER Fixkomma. int64_t mit Faktor 10000 ist ne gute Wahl.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1314257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1314257</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Tue, 26 Jun 2007 18:38:35 GMT</pubDate></item><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Tue, 26 Jun 2007 21:04:53 GMT]]></title><description><![CDATA[<p>find long besser, das gibs wenigstens in jedem compiler ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1314368</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1314368</guid><dc:creator><![CDATA[thordk]]></dc:creator><pubDate>Tue, 26 Jun 2007 21:04:53 GMT</pubDate></item><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Tue, 26 Jun 2007 21:46:47 GMT]]></title><description><![CDATA[<p>hustbaer schrieb:</p>
<blockquote>
<p>Tip: für Geldbeträge grundsätzlich *niemals* float oder double verwenden. IMMER Fixkomma. int64_t mit Faktor 10000 ist ne gute Wahl.</p>
</blockquote>
<p>Fixkomma ist nicht das entscheidende, sondern dass der Faktor eine Zehnerpotenz ist. &quot;Normales&quot; Fixkomma mit so und soviel binären Nachkommastellen bringt genau gar keinen Vorteil gegenüber float, weil du dezimale Nachkommastellen genauso nicht exakt darstellen kannst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1314395</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1314395</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Tue, 26 Jun 2007 21:46:47 GMT</pubDate></item><item><title><![CDATA[Reply to Konto-Programm mit C++ (Objektorientiertes Programmieren) on Tue, 26 Jun 2007 22:55:02 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/904">@Bashar</a>: ich hab' ja auch geschrieben Faktor 10000. Ich dachte mir es sei logisch und nicht der Rede wert dass es eine Zehnerpotenz sein muss.</p>
<p>Was die theoretische Möglichkeit von dezimalem Gleitkomma angeht: für Geldbeträge sinnlos, da man immer eine min. Anzahl an Nachkommastellen garantieren muss. Und ich wüsste auch keine Anwendung wo man mehr als diese minimale Anzahl für irgendwas brauchen könnte. Und wenn ich eine minimale Anzahl an Nachkommastellen garantieren muss, und auch nie mehr als diese minimale Anzahl an Nachkommastellen brauchen kann... dann brauche ich eben auch kein Gleitkomma. Logisch, oder <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/1314416</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1314416</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Tue, 26 Jun 2007 22:55:02 GMT</pubDate></item></channel></rss>