<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki.freitagsrunde.org/index.php?action=history&amp;feed=atom&amp;title=Javakurs%2F%C3%9Cbungsaufgaben%2FKassenbon%2B%2B</id>
	<title>Javakurs/Übungsaufgaben/Kassenbon++ - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.freitagsrunde.org/index.php?action=history&amp;feed=atom&amp;title=Javakurs%2F%C3%9Cbungsaufgaben%2FKassenbon%2B%2B"/>
	<link rel="alternate" type="text/html" href="https://wiki.freitagsrunde.org/index.php?title=Javakurs/%C3%9Cbungsaufgaben/Kassenbon%2B%2B&amp;action=history"/>
	<updated>2026-04-24T23:28:20Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in FreitagsrundenWiki</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.freitagsrunde.org/index.php?title=Javakurs/%C3%9Cbungsaufgaben/Kassenbon%2B%2B&amp;diff=20686&amp;oldid=prev</id>
		<title>141.23.73.201: /* Vorgabe */</title>
		<link rel="alternate" type="text/html" href="https://wiki.freitagsrunde.org/index.php?title=Javakurs/%C3%9Cbungsaufgaben/Kassenbon%2B%2B&amp;diff=20686&amp;oldid=prev"/>
		<updated>2013-03-07T09:46:40Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Vorgabe&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Version vom 7. März 2013, 09:46 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l34&quot; &gt;Zeile 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;╔════════════════════════╗&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;╔════════════════════════╗&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;║ FreitagsrundenShop 042 ║&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;║ FreitagsrundenShop 042 ║&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;║ &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; Franklinstr&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;28/29&amp;#160;  &lt;/del&gt;║&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;║ &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160;  Marchstr&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;23&amp;#160; &amp;#160; &lt;/ins&gt;║&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;║&amp;#160; &amp;#160; &amp;#160;  10587 Berlin&amp;#160; &amp;#160;  ║&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;║&amp;#160; &amp;#160; &amp;#160;  10587 Berlin&amp;#160; &amp;#160;  ║&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;║&amp;#160; &amp;#160;  ☏ 030 314 213 86&amp;#160;  ║&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;║&amp;#160; &amp;#160;  ☏ 030 314 213 86&amp;#160;  ║&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l53&quot; &gt;Zeile 53:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 53:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Aufgabe =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Aufgabe =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff::1.12:old-20064:rev-20686 --&gt;
&lt;/table&gt;</summary>
		<author><name>141.23.73.201</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.freitagsrunde.org/index.php?title=Javakurs/%C3%9Cbungsaufgaben/Kassenbon%2B%2B&amp;diff=20064&amp;oldid=prev</id>
		<title>Alibaba: /* Aufgabe */</title>
		<link rel="alternate" type="text/html" href="https://wiki.freitagsrunde.org/index.php?title=Javakurs/%C3%9Cbungsaufgaben/Kassenbon%2B%2B&amp;diff=20064&amp;oldid=prev"/>
		<updated>2013-03-02T18:56:11Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Aufgabe&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Version vom 2. März 2013, 18:56 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l62&quot; &gt;Zeile 62:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 62:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Schreibe eine Klasse '''Receipt''', die alle gekauften Gegenstände aufnimmt.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Schreibe eine Klasse '''Receipt''', die alle gekauften Gegenstände aufnimmt.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Füge einen '''''no-argument-''Konstruktor''' hinzu&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Füge einen '''''no-argument-''Konstruktor''' hinzu&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Als einzige Eigenschaft brauchst du hier einen dynamischen Speicher, der beliebig viele Objekte aufnehmen kann. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Am besten &lt;/del&gt;die '''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Vector&lt;/del&gt;'''-Klasse aus der &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;JavaAPI&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Als einzige Eigenschaft brauchst du hier einen dynamischen Speicher, der beliebig viele Objekte aufnehmen kann. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Zum Beispiel &lt;/ins&gt;die '''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ArrayList&lt;/ins&gt;'''-Klasse aus der &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Java Collections API&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** Schau dir dazu die [http://download.oracle.com/javase/6/docs/api/java/util/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Vector&lt;/del&gt;.html Dokumentation von &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Vector &lt;/del&gt;in der Java6 API] an. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** Schau dir dazu die [http://download.oracle.com/javase/6/docs/api/java/util/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ArrayList&lt;/ins&gt;.html Dokumentation von &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ArrayList &lt;/ins&gt;in der Java6 API] an. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** Als Typ brauchst du dann '''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Vector&lt;/del&gt;&amp;lt;ReceiptItem&amp;gt;''' &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** Als Typ brauchst du dann '''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ArrayList&lt;/ins&gt;&amp;lt;ReceiptItem&amp;gt;''' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Eine Liste&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;die nur Werte vom Typ ReceiptItem aufnehmen kann. Wenn du mehr über diese Art von Typen wissen möchtest&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;dann befrage eine Suchmaschine &lt;/ins&gt;oder einen Tutor &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;nach dem Stichwort '''Generics'''&lt;/ins&gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;***:&lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Was genau dies bedeutet&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ist erstmal egal&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;dass kannst du dir später selbst aneigenen &lt;/del&gt;oder &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;jetzt &lt;/del&gt;einen Tutor &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;fragen&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** Wichtig ist die Methode '''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;List&lt;/ins&gt;.add()''', welche ein Objekt anfügt.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** Wichtig ist die Methode '''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Vector&lt;/del&gt;.add(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;..&lt;/del&gt;)''', welche ein Objekt anfügt.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Schreibe dir auch noch eine Methode '''print''', die alle Elemente des Vectors ausgibt.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Schreibe dir auch noch eine Methode '''print''', die alle Elemente des Vectors ausgibt.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**: &amp;lt;pre&amp;gt;for( ReceiptItem item : &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;VECTOR &lt;/del&gt;){ }&amp;lt;/pre&amp;gt; gibt dir innerhalb der Schleife in der Variable ''item'' alle Elemente zurück, wenn du für '''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;VECTOR&lt;/del&gt;''' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;deinen &lt;/del&gt;Variable vom Typ ''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Vector&lt;/del&gt;'' von oben angibst.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**: &amp;lt;pre&amp;gt;for( ReceiptItem item : &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;aList &lt;/ins&gt;){ }&amp;lt;/pre&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ist eine spezielle Form der for-Schleife (foreach) und &lt;/ins&gt;gibt dir innerhalb der Schleife in der Variable ''item'' alle Elemente zurück, wenn du für '''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;aList&lt;/ins&gt;''' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;deine &lt;/ins&gt;Variable vom Typ ''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;List&lt;/ins&gt;'' von oben angibst.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Schreibe des Weiteren eine Klasse '''ReceiptItem''' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;welche nacher zu der '''Receipt'''-Klasse hinzugefügt werden wird&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Schreibe des Weiteren eine Klasse '''ReceiptItem'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Diese braucht alle '''Eigenschaften''' eines Rechnungsgegenstandes, also ''Name'', ''Preis''(pro Einheit) und ''Anzahl''(der Einheiten)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Diese braucht alle '''Eigenschaften''' eines Rechnungsgegenstandes, also ''Name'', ''Preis''(pro Einheit) und ''Anzahl''(der Einheiten)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Stelle sicher, dass die Eigenschaften nur innerhalb der Klasse verändert werden können ('''public''' vs. '''private''' vs. '''protected''', welches ist hier richtig, warum?)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Stelle sicher, dass die Eigenschaften nur innerhalb der Klasse verändert werden können ('''public''' vs. '''private''' vs. '''protected''', welches ist hier richtig&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;?&lt;/ins&gt;, warum?)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Schreibe für jede Eigenschaft einen '''getter''' und einen '''setter'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Schreibe für jede Eigenschaft einen '''getter''' und einen '''setter'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Denke dran, bei den '''setter'''-Methoden die Eingabewerte zu überprüfen, damit du bspw. keine negativen &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;anzahlen &lt;/del&gt;für Gegenstände angeben kannst&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Denke dran, bei den '''setter'''-Methoden die Eingabewerte zu überprüfen, damit du bspw. keine negativen &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Anzahlen &lt;/ins&gt;für Gegenstände angeben kannst&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Erstelle letzlich auch einen '''Konstruktor''' mit allen drei '''Eigenschaften'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Erstelle letzlich auch einen '''Konstruktor''' mit allen drei '''Eigenschaften'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff::1.12:old-20063:rev-20064 --&gt;
&lt;/table&gt;</summary>
		<author><name>Alibaba</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.freitagsrunde.org/index.php?title=Javakurs/%C3%9Cbungsaufgaben/Kassenbon%2B%2B&amp;diff=20063&amp;oldid=prev</id>
		<title>Alibaba: default-Konstruktoren kann man nicht hinzufügen ...</title>
		<link rel="alternate" type="text/html" href="https://wiki.freitagsrunde.org/index.php?title=Javakurs/%C3%9Cbungsaufgaben/Kassenbon%2B%2B&amp;diff=20063&amp;oldid=prev"/>
		<updated>2013-03-02T18:40:19Z</updated>

		<summary type="html">&lt;p&gt;default-Konstruktoren kann man nicht hinzufügen ...&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Version vom 2. März 2013, 18:40 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l61&quot; &gt;Zeile 61:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 61:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Das heißt:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Das heißt:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Schreibe eine Klasse '''Receipt''', die alle gekauften Gegenstände aufnimmt.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Schreibe eine Klasse '''Receipt''', die alle gekauften Gegenstände aufnimmt.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Füge einen '''''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;default&lt;/del&gt;-''Konstruktor''' hinzu&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Füge einen '''''&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;no-argument&lt;/ins&gt;-''Konstruktor''' hinzu&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Als einzige Eigenschaft brauchst du hier einen dynamischen Speicher, der beliebig viele Objekte aufnehmen kann. Am besten die '''Vector'''-Klasse aus der JavaAPI.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Als einzige Eigenschaft brauchst du hier einen dynamischen Speicher, der beliebig viele Objekte aufnehmen kann. Am besten die '''Vector'''-Klasse aus der JavaAPI.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** Schau dir dazu die [http://download.oracle.com/javase/6/docs/api/java/util/Vector.html Dokumentation von Vector in der Java6 API] an. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** Schau dir dazu die [http://download.oracle.com/javase/6/docs/api/java/util/Vector.html Dokumentation von Vector in der Java6 API] an. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l75&quot; &gt;Zeile 75:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 75:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Denke dran, bei den '''setter'''-Methoden die Eingabewerte zu überprüfen, damit du bspw. keine negativen anzahlen für Gegenstände angeben kannst&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Denke dran, bei den '''setter'''-Methoden die Eingabewerte zu überprüfen, damit du bspw. keine negativen anzahlen für Gegenstände angeben kannst&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Erstelle letzlich auch einen '''Konstruktor''' mit allen drei '''Eigenschaften'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Erstelle letzlich auch einen '''Konstruktor''' mit allen drei '''Eigenschaften'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Abschluss =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Abschluss =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff::1.12:old-15695:rev-20063 --&gt;
&lt;/table&gt;</summary>
		<author><name>Alibaba</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.freitagsrunde.org/index.php?title=Javakurs/%C3%9Cbungsaufgaben/Kassenbon%2B%2B&amp;diff=15695&amp;oldid=prev</id>
		<title>Mario: Neue Aufgabe</title>
		<link rel="alternate" type="text/html" href="https://wiki.freitagsrunde.org/index.php?title=Javakurs/%C3%9Cbungsaufgaben/Kassenbon%2B%2B&amp;diff=15695&amp;oldid=prev"/>
		<updated>2011-02-26T11:51:09Z</updated>

		<summary type="html">&lt;p&gt;Neue Aufgabe&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Diese Aufgabe wird dir zeigen, wie man die Aufgabe [[Javakurs/Übungsaufgaben/Kassenbon]] via Kapselung löst.&lt;br /&gt;
&lt;br /&gt;
= Vorgabe =&lt;br /&gt;
Folgender Code könnte als Einstiegspunkt für einen Objektorientierten Kassebon dienen. Dabei sollen mehrere Klassen miteinander interagieren: '''Receipt''' (der eigentliche Kassenbon) und '''ReceiptItem'''(ein Eintrag in dem Kassenbon). Am Anfang der '''main'''-Methode wird der Kassebon erstellt. Dannach werden vier Einträge an den Bon angefügt und letzlich der Bon ausgegeben. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Main class for Receipt++&lt;br /&gt;
 *&lt;br /&gt;
 * @author Mario&lt;br /&gt;
 */&lt;br /&gt;
public class Main {&lt;br /&gt;
&lt;br /&gt;
	/**&lt;br /&gt;
	 * This method will start all sub tests defined.&lt;br /&gt;
	 */&lt;br /&gt;
	public static void main(String[] args) {&lt;br /&gt;
		// buy some items and create a receipt for it&lt;br /&gt;
		Receipt r = new Receipt();		&lt;br /&gt;
		r.add( new ReceiptItem(&amp;quot;15 Fischstäbchen&amp;quot;, 3, 1.79) );&lt;br /&gt;
		r.add( new ReceiptItem(&amp;quot;Steaks&amp;quot;, 5, 3.99) );&lt;br /&gt;
		r.add( new ReceiptItem(&amp;quot;Naturelle (1l)&amp;quot;, 6, 4.99) );&lt;br /&gt;
		r.add( new ReceiptItem(&amp;quot;Magnum Eis Creme&amp;quot;, 2, 2.99) );&lt;br /&gt;
		&lt;br /&gt;
		// output receipt in a linear fashion&lt;br /&gt;
		r.print();&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Folgendes könnte die Ausgabe sein:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
╔════════════════════════╗&lt;br /&gt;
║ FreitagsrundenShop 042 ║&lt;br /&gt;
║   Franklinstr. 28/29   ║&lt;br /&gt;
║       10587 Berlin     ║&lt;br /&gt;
║     ☏ 030 314 213 86   ║&lt;br /&gt;
╚════════════════════════╝&lt;br /&gt;
&lt;br /&gt;
15 Fischstäbchen         &lt;br /&gt;
  3x                  1.79&lt;br /&gt;
Steaks                   &lt;br /&gt;
  5x                  3.99&lt;br /&gt;
Naturelle (1l)           &lt;br /&gt;
  6x                  4.99&lt;br /&gt;
Magnum Eis Creme         &lt;br /&gt;
  2x                  2.99&lt;br /&gt;
&lt;br /&gt;
                     =====&lt;br /&gt;
Summe EUR            61.24&lt;br /&gt;
                     =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Aufgabe =&lt;br /&gt;
&lt;br /&gt;
Sobald du die Idee der '''Vorgabe''' verstanden hast, solltest du dir folgende Aufgaben ansehen, damit du lauffähigen Code erzeugst:&lt;br /&gt;
&lt;br /&gt;
Das heißt:&lt;br /&gt;
* Schreibe eine Klasse '''Receipt''', die alle gekauften Gegenstände aufnimmt.&lt;br /&gt;
** Füge einen '''''default-''Konstruktor''' hinzu&lt;br /&gt;
** Als einzige Eigenschaft brauchst du hier einen dynamischen Speicher, der beliebig viele Objekte aufnehmen kann. Am besten die '''Vector'''-Klasse aus der JavaAPI.&lt;br /&gt;
*** Schau dir dazu die [http://download.oracle.com/javase/6/docs/api/java/util/Vector.html Dokumentation von Vector in der Java6 API] an. &lt;br /&gt;
*** Als Typ brauchst du dann '''Vector&amp;lt;ReceiptItem&amp;gt;''' &lt;br /&gt;
***:(Was genau dies bedeutet, ist erstmal egal, dass kannst du dir später selbst aneigenen oder jetzt einen Tutor fragen)&lt;br /&gt;
*** Wichtig ist die Methode '''Vector.add(..)''', welche ein Objekt anfügt.&lt;br /&gt;
** Schreibe dir auch noch eine Methode '''print''', die alle Elemente des Vectors ausgibt.&lt;br /&gt;
**: &amp;lt;pre&amp;gt;for( ReceiptItem item : VECTOR ){ }&amp;lt;/pre&amp;gt; gibt dir innerhalb der Schleife in der Variable ''item'' alle Elemente zurück, wenn du für '''VECTOR''' deinen Variable vom Typ ''Vector'' von oben angibst.&lt;br /&gt;
* Schreibe des Weiteren eine Klasse '''ReceiptItem''' welche nacher zu der '''Receipt'''-Klasse hinzugefügt werden wird.&lt;br /&gt;
** Diese braucht alle '''Eigenschaften''' eines Rechnungsgegenstandes, also ''Name'', ''Preis''(pro Einheit) und ''Anzahl''(der Einheiten)&lt;br /&gt;
** Stelle sicher, dass die Eigenschaften nur innerhalb der Klasse verändert werden können ('''public''' vs. '''private''' vs. '''protected''', welches ist hier richtig, warum?)&lt;br /&gt;
** Schreibe für jede Eigenschaft einen '''getter''' und einen '''setter'''&lt;br /&gt;
** Denke dran, bei den '''setter'''-Methoden die Eingabewerte zu überprüfen, damit du bspw. keine negativen anzahlen für Gegenstände angeben kannst&lt;br /&gt;
** Erstelle letzlich auch einen '''Konstruktor''' mit allen drei '''Eigenschaften'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Abschluss =&lt;br /&gt;
&lt;br /&gt;
Teste nun, ob deine Implementierung den Vorgaben entspricht. &lt;br /&gt;
&lt;br /&gt;
Auch ist zu empfehlen jetzt noch etwas mit dem Code zu ''spielen''. Folgende Aufgaben sind nur als Anregung gedacht, und werden ohne Musterlösung gegeben:&lt;br /&gt;
* füge weitere Objekte ein&lt;br /&gt;
* versuche die Kapselung zu brechen (Negative Preise, Leere Namen, ...). &lt;br /&gt;
* Brieftaschen Aufgabe lösen: Was müsstest du tun, um eine Rechnung zu erstellen, die möglichst genau einen gegebenen Betrag kostet.&lt;/div&gt;</summary>
		<author><name>Mario</name></author>
		
	</entry>
</feed>