<?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[Importer:Error:WasEmpty]]></title><description><![CDATA[<p>Hallo</p>
<p>ich bin Programmierneuling und arbeite gerade das Buch &quot;Einführung in die Programmierung mit C++ - Bjarne Stroustrup&quot; durch. Eigentlich meine ich bisher alles zu verstehen, bleibe aber nun bei einer &quot;Testen Sie ihr können&quot; Aufgabe auf Seite 133, hängen.</p>
<p>Meine Lösung:</p>
<pre><code>#include &quot;std_lib_facilities.h&quot;

int main()
{
	const double euro_per_dollar = 1.3371;
	const double yen_per_dollar = 0.010;
	const double pound_per_dollar = 1.6013;
	char unit = ' ';
	double amount = 0;

	cout 	&lt;&lt; &quot;Yen: y&quot;
		&lt;&lt; &quot;\nEuro: e&quot;
		&lt;&lt; &quot;\nPfund: p&quot;
		&lt;&lt; &quot;\n\nGeben Sie den Betrag und das Währungskürzel ein: &quot;;
	cin &gt;&gt; amount &gt;&gt; unit;

	if(unit == 'y')
		{
			cout &lt;&lt; &quot;\n&quot; &lt;&lt; amount &lt;&lt; &quot; Yen == &quot; &lt;&lt; amount * yen_per_dollar &lt;&lt; &quot; US$\n&quot;;
		}
	else if (unit == 'e')
		{
			cout &lt;&lt; &quot;\n&quot; &lt;&lt; amount &lt;&lt; &quot; Euro == &quot; &lt;&lt; amount * euro_per_dollar &lt;&lt; &quot; US$\n&quot;;
		}
	else if (unit == 'p')
		{
			cout &lt;&lt; &quot;\n&quot; &lt;&lt; amount &lt;&lt; &quot; Pfund Stirling == &quot; &lt;&lt; amount * pound_per_dollar &lt;&lt; &quot;US$\n&quot;;
		}
	else 
		{
			cout &lt;&lt; &quot;\nFehler: Die Währung ist unbekannt\n&quot;;
		}
}
</code></pre>
<p>Wenn ich das Programm teste, kann ich z.B. 10y eingeben und bekomme das Ergebnis für Yen. Gebe ich 10p ein, bekomme ich das Ergebnis für Pfund.<br />
Wenn ich aber 10e eingebe, bekomme ich nur &quot;Fehler: Die Währung ist unbekannt&quot;. Wenn ich dafür 10 e eingebe, bekomme ich das richtige Ergebnis für Euro.</p>
<p>Warum muss ich bei e ein Leerzeichen einfügen bzw. wo ist mein Fehler?</p>
<p>Gruß<br />
dirac</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/321408/importer-error-wasempty</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 08:13:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/321408.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 Nov 2013 15:30:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Importer:Error:WasEmpty on Sun, 10 Nov 2013 15:32:41 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>ich bin Programmierneuling und arbeite gerade das Buch &quot;Einführung in die Programmierung mit C++ - Bjarne Stroustrup&quot; durch. Eigentlich meine ich bisher alles zu verstehen, bleibe aber nun bei einer &quot;Testen Sie ihr können&quot; Aufgabe auf Seite 133, hängen.</p>
<p>Meine Lösung:</p>
<pre><code>#include &quot;std_lib_facilities.h&quot;

int main()
{
	const double euro_per_dollar = 1.3371;
	const double yen_per_dollar = 0.010;
	const double pound_per_dollar = 1.6013;
	char unit = ' ';
	double amount = 0;

	cout 	&lt;&lt; &quot;Yen: y&quot;
		&lt;&lt; &quot;\nEuro: e&quot;
		&lt;&lt; &quot;\nPfund: p&quot;
		&lt;&lt; &quot;\n\nGeben Sie den Betrag und das Währungskürzel ein: &quot;;
	cin &gt;&gt; amount &gt;&gt; unit;

	if(unit == 'y')
		{
			cout &lt;&lt; &quot;\n&quot; &lt;&lt; amount &lt;&lt; &quot; Yen == &quot; &lt;&lt; amount * yen_per_dollar &lt;&lt; &quot; US$\n&quot;;
		}
	else if (unit == 'e')
		{
			cout &lt;&lt; &quot;\n&quot; &lt;&lt; amount &lt;&lt; &quot; Euro == &quot; &lt;&lt; amount * euro_per_dollar &lt;&lt; &quot; US$\n&quot;;
		}
	else if (unit == 'p')
		{
			cout &lt;&lt; &quot;\n&quot; &lt;&lt; amount &lt;&lt; &quot; Pfund Stirling == &quot; &lt;&lt; amount * pound_per_dollar &lt;&lt; &quot;US$\n&quot;;
		}
	else 
		{
			cout &lt;&lt; &quot;\nFehler: Die Währung ist unbekannt\n&quot;;
		}
}
</code></pre>
<p>Wenn ich das Programm teste, kann ich z.B. 10y eingeben und bekomme das Ergebnis für Yen. Gebe ich 10p ein, bekomme ich das Ergebnis für Pfund.<br />
Wenn ich aber 10e eingebe, bekomme ich nur &quot;Fehler: Die Währung ist unbekannt&quot;. Wenn ich dafür 10 e eingebe, bekomme ich das richtige Ergebnis für Euro.</p>
<p>Warum muss ich bei e ein Leerzeichen einfügen bzw. wo ist mein Fehler?</p>
<p>Gruß<br />
dirac</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2364738</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2364738</guid><dc:creator><![CDATA[dirac]]></dc:creator><pubDate>Sun, 10 Nov 2013 15:32:41 GMT</pubDate></item><item><title><![CDATA[Reply to Importer:Error:WasEmpty on Sun, 10 Nov 2013 16:13:55 GMT]]></title><description><![CDATA[<p>Das Problem ist, soweit ich sehe, dass du Fließkommazahlen verwendest (10e ist eine Hälfte der Notation einer Fließkommazahl). Was passiert, wenn du <code>int</code> für <code>amount</code> nimmst?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2364746</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2364746</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Sun, 10 Nov 2013 16:13:55 GMT</pubDate></item><item><title><![CDATA[Reply to Importer:Error:WasEmpty on Sun, 10 Nov 2013 17:31:41 GMT]]></title><description><![CDATA[<p>Das funktioniert - danke!</p>
<p>Als double versucht das Programm 10e als wissenschaftliche Schreibweise zu interpretieren. Verstehe ich das richtig?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2364772</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2364772</guid><dc:creator><![CDATA[dirac]]></dc:creator><pubDate>Sun, 10 Nov 2013 17:31:41 GMT</pubDate></item><item><title><![CDATA[Reply to Importer:Error:WasEmpty on Sun, 10 Nov 2013 17:34:55 GMT]]></title><description><![CDATA[<p>dirac schrieb:</p>
<blockquote>
<p>Als double versucht das Programm 10e als wissenschaftliche Schreibweise zu interpretieren. Verstehe ich das richtig?</p>
</blockquote>
<p>Ganz genau.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2364773</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2364773</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Sun, 10 Nov 2013 17:34:55 GMT</pubDate></item></channel></rss>