From 7ee9f7f2357f249b3d3255d66ef3b28148fe1d63 Mon Sep 17 00:00:00 2001 From: wbs Date: Tue, 11 Aug 2026 11:40:28 +0200 Subject: [PATCH] Unterricht 11.08. --- Tag 2/.Vererbung.cs.kate-swp | Bin 2013 -> 0 bytes Tag 2/Aufgaben/Aufgabe_1.txt | 10 + Tag 2/Aufgaben/Aufgabe_2.txt | 14 + Tag 2/Aufgaben/Aufgabe_3.txt | 15 + Tag 2/Aufgaben/Aufgaben.csproj | 10 + Tag 2/Aufgaben/Lösung_1/Lösung_1.txt | 13 + Tag 2/Aufgaben/Lösung_1/Song.txt | 35 ++ Tag 2/Aufgaben/Lösung_2/Lösung_2.txt | 32 ++ Tag 2/Aufgaben/Lösung_2/Robot.txt | 32 ++ Tag 2/Aufgaben/Lösung_3/Artikel.txt | 108 ++++++ Tag 2/Aufgaben/Lösung_3/Class.dia | Bin 0 -> 2326 bytes Tag 2/Aufgaben/Lösung_3/Lösung_3.txt | 114 ++++++ Tag 2/Aufgaben/Lösung_3/UseCase.dia | Bin 0 -> 2148 bytes Tag 2/Aufgaben/Lösung_3/Warenkorb.txt | 141 +++++++ Tag 2/Aufgaben/Lösung_3/WarenkorbItem.txt | 58 +++ Tag 2/Aufgaben/Lösung_3v2/Artikel.txt | 31 ++ Tag 2/Aufgaben/Lösung_3v2/Program.txt | 42 +++ Tag 2/Aufgaben/Lösung_3v2/Warenkorb.txt | 95 +++++ Tag 2/Aufgaben/Lösung_3v2/WarenkorbItem.txt | 22 ++ Tag 2/Aufgaben/Program.cs | 2 + .../obj/Aufgaben.csproj.nuget.dgspec.json | 342 +++++++++++++++++ .../obj/Aufgaben.csproj.nuget.g.props} | 0 .../obj/Aufgaben.csproj.nuget.g.targets} | 0 Tag 2/Aufgaben/obj/project.assets.json | 347 ++++++++++++++++++ Tag 2/Aufgaben/obj/project.nuget.cache | 8 + Tag 2/{ => Unterricht}/Program.cs | 1 + Tag 2/{ => Unterricht}/Statische_Felder.cs | 0 Tag 2/{ => Unterricht}/Tag 2.csproj | 0 Tag 2/Unterricht/Vererbung.cs | 70 ++++ .../{ => Unterricht}/bin/Debug/net10.0/Tag 2 | Bin .../bin/Debug/net10.0/Tag 2.deps.json | 0 Tag 2/Unterricht/bin/Debug/net10.0/Tag 2.dll | Bin 0 -> 6144 bytes .../bin/Debug/net10.0/Tag 2.pdb | Bin 11292 -> 11736 bytes .../Debug/net10.0/Tag 2.runtimeconfig.json | 0 ...oreApp,Version=v10.0.AssemblyAttributes.cs | 0 .../obj/Debug/net10.0/Tag 2.AssemblyInfo.cs | 2 +- .../net10.0/Tag 2.AssemblyInfoInputs.cache | 1 + ....GeneratedMSBuildEditorConfig.editorconfig | 0 .../obj/Debug/net10.0/Tag 2.GlobalUsings.g.cs | 0 .../obj/Debug/net10.0/Tag 2.assets.cache | Bin .../Tag 2.csproj.CoreCompileInputs.cache | 0 .../net10.0/Tag 2.csproj.FileListAbsolute.txt | 0 Tag 2/Unterricht/obj/Debug/net10.0/Tag 2.dll | Bin 0 -> 6144 bytes .../net10.0/Tag 2.genruntimeconfig.cache | 0 .../obj/Debug/net10.0/Tag 2.pdb | Bin 11292 -> 11736 bytes .../obj/Debug/net10.0/apphost | Bin .../obj/Debug/net10.0/ref/Tag 2.dll | Bin 0 -> 6144 bytes .../obj/Debug/net10.0/refint/Tag 2.dll | Bin 0 -> 6144 bytes .../obj/Tag 2.csproj.nuget.dgspec.json | 0 .../Unterricht/obj/Tag 2.csproj.nuget.g.props | 15 + .../obj/Tag 2.csproj.nuget.g.targets | 2 + .../{ => Unterricht}/obj/project.assets.json | 0 .../{ => Unterricht}/obj/project.nuget.cache | 0 Tag 2/Vererbung.cs | 38 -- Tag 2/bin/Debug/net10.0/Tag 2.dll | Bin 5120 -> 0 bytes .../net10.0/Tag 2.AssemblyInfoInputs.cache | 1 - Tag 2/obj/Debug/net10.0/Tag 2.dll | Bin 5120 -> 0 bytes Tag 2/obj/Debug/net10.0/ref/Tag 2.dll | Bin 5632 -> 0 bytes Tag 2/obj/Debug/net10.0/refint/Tag 2.dll | Bin 5632 -> 0 bytes 59 files changed, 1561 insertions(+), 40 deletions(-) delete mode 100644 Tag 2/.Vererbung.cs.kate-swp create mode 100644 Tag 2/Aufgaben/Aufgabe_1.txt create mode 100644 Tag 2/Aufgaben/Aufgabe_2.txt create mode 100644 Tag 2/Aufgaben/Aufgabe_3.txt create mode 100644 Tag 2/Aufgaben/Aufgaben.csproj create mode 100644 Tag 2/Aufgaben/Lösung_1/Lösung_1.txt create mode 100644 Tag 2/Aufgaben/Lösung_1/Song.txt create mode 100644 Tag 2/Aufgaben/Lösung_2/Lösung_2.txt create mode 100644 Tag 2/Aufgaben/Lösung_2/Robot.txt create mode 100644 Tag 2/Aufgaben/Lösung_3/Artikel.txt create mode 100644 Tag 2/Aufgaben/Lösung_3/Class.dia create mode 100644 Tag 2/Aufgaben/Lösung_3/Lösung_3.txt create mode 100644 Tag 2/Aufgaben/Lösung_3/UseCase.dia create mode 100644 Tag 2/Aufgaben/Lösung_3/Warenkorb.txt create mode 100644 Tag 2/Aufgaben/Lösung_3/WarenkorbItem.txt create mode 100644 Tag 2/Aufgaben/Lösung_3v2/Artikel.txt create mode 100644 Tag 2/Aufgaben/Lösung_3v2/Program.txt create mode 100644 Tag 2/Aufgaben/Lösung_3v2/Warenkorb.txt create mode 100644 Tag 2/Aufgaben/Lösung_3v2/WarenkorbItem.txt create mode 100644 Tag 2/Aufgaben/Program.cs create mode 100644 Tag 2/Aufgaben/obj/Aufgaben.csproj.nuget.dgspec.json rename Tag 2/{obj/Tag 2.csproj.nuget.g.props => Aufgaben/obj/Aufgaben.csproj.nuget.g.props} (100%) rename Tag 2/{obj/Tag 2.csproj.nuget.g.targets => Aufgaben/obj/Aufgaben.csproj.nuget.g.targets} (100%) create mode 100644 Tag 2/Aufgaben/obj/project.assets.json create mode 100644 Tag 2/Aufgaben/obj/project.nuget.cache rename Tag 2/{ => Unterricht}/Program.cs (61%) rename Tag 2/{ => Unterricht}/Statische_Felder.cs (100%) rename Tag 2/{ => Unterricht}/Tag 2.csproj (100%) create mode 100644 Tag 2/Unterricht/Vererbung.cs rename Tag 2/{ => Unterricht}/bin/Debug/net10.0/Tag 2 (100%) rename Tag 2/{ => Unterricht}/bin/Debug/net10.0/Tag 2.deps.json (100%) create mode 100644 Tag 2/Unterricht/bin/Debug/net10.0/Tag 2.dll rename Tag 2/{ => Unterricht}/bin/Debug/net10.0/Tag 2.pdb (86%) rename Tag 2/{ => Unterricht}/bin/Debug/net10.0/Tag 2.runtimeconfig.json (100%) rename Tag 2/{ => Unterricht}/obj/Debug/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.cs (100%) rename Tag 2/{ => Unterricht}/obj/Debug/net10.0/Tag 2.AssemblyInfo.cs (94%) create mode 100644 Tag 2/Unterricht/obj/Debug/net10.0/Tag 2.AssemblyInfoInputs.cache rename Tag 2/{ => Unterricht}/obj/Debug/net10.0/Tag 2.GeneratedMSBuildEditorConfig.editorconfig (100%) rename Tag 2/{ => Unterricht}/obj/Debug/net10.0/Tag 2.GlobalUsings.g.cs (100%) rename Tag 2/{ => Unterricht}/obj/Debug/net10.0/Tag 2.assets.cache (100%) rename Tag 2/{ => Unterricht}/obj/Debug/net10.0/Tag 2.csproj.CoreCompileInputs.cache (100%) rename Tag 2/{ => Unterricht}/obj/Debug/net10.0/Tag 2.csproj.FileListAbsolute.txt (100%) create mode 100644 Tag 2/Unterricht/obj/Debug/net10.0/Tag 2.dll rename Tag 2/{ => Unterricht}/obj/Debug/net10.0/Tag 2.genruntimeconfig.cache (100%) rename Tag 2/{ => Unterricht}/obj/Debug/net10.0/Tag 2.pdb (86%) rename Tag 2/{ => Unterricht}/obj/Debug/net10.0/apphost (100%) create mode 100644 Tag 2/Unterricht/obj/Debug/net10.0/ref/Tag 2.dll create mode 100644 Tag 2/Unterricht/obj/Debug/net10.0/refint/Tag 2.dll rename Tag 2/{ => Unterricht}/obj/Tag 2.csproj.nuget.dgspec.json (100%) create mode 100644 Tag 2/Unterricht/obj/Tag 2.csproj.nuget.g.props create mode 100644 Tag 2/Unterricht/obj/Tag 2.csproj.nuget.g.targets rename Tag 2/{ => Unterricht}/obj/project.assets.json (100%) rename Tag 2/{ => Unterricht}/obj/project.nuget.cache (100%) delete mode 100644 Tag 2/Vererbung.cs delete mode 100644 Tag 2/bin/Debug/net10.0/Tag 2.dll delete mode 100644 Tag 2/obj/Debug/net10.0/Tag 2.AssemblyInfoInputs.cache delete mode 100644 Tag 2/obj/Debug/net10.0/Tag 2.dll delete mode 100644 Tag 2/obj/Debug/net10.0/ref/Tag 2.dll delete mode 100644 Tag 2/obj/Debug/net10.0/refint/Tag 2.dll diff --git a/Tag 2/.Vererbung.cs.kate-swp b/Tag 2/.Vererbung.cs.kate-swp deleted file mode 100644 index f7a9221f3c037c3605b9d8870762c2b4426c9c8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2013 zcmbW2yKWOv5QcX{AaP7?c8Ce#vbh0<$O2j_f*i>LQQ#tV0w!355CsDgh!@})ka!Wg zG&}<(4Lvml^Zh={3@$m+X3sY>J7>;ZoGi;~4|WH=qWf<5sMziw^ol#JTUnMZ{AyLd zP490tZm)0r{PFql`}?&|zq>o8so9gawXNGWYj->LcY&>~yziXDht6a0!1)y1a~_9} zolnEhoX^0!&J*wx=SevDtH6cpr{Ior6@KJ=77qTW;oyG;e(v_O@EhkjINWz0-gmt+ z_qyGEY;y7i*BvphIpS^Jk;CR3iDlN2P-pxkMIItmF8+lo23ZK99^SDi{{5d#O zdU1psaH!OI_+Z#n_*xpe#tkd~z`=3~eQbA!rjpQ;_|LG>#@^$Ft)Y`^hKhI7S@8zF z9Hq{{Uh!_bz2dd_I08NKj-7mU!IBAbD{X0TVT70AG#WU#2&dM7FTpST`^#`j5c(@{ z_`ZNsf}6Hyg*zkCG#w3H!kVVkt+1wP&-D`~qXr#&qt`U0BjF1AG!3w(DdiB>G`;oj zHBGOa)sw-Wdh)63)sw-WrsDhSQ*gQkT!mAk!?DV+s+_tAR+UrQ zU{$&0=c&p&&Z=_yrNUlSwyvQ_F!uHGPC#YnxIgGU>>q|hJk@;SsV={hWVIyC=BkGv z-g4HghAU}SQzPPEvzi78)~p6DOjiCILcanB{VE*%uff6p`iT9;2w#O)Jl-aJ*IMfj D$q>R_ diff --git a/Tag 2/Aufgaben/Aufgabe_1.txt b/Tag 2/Aufgaben/Aufgabe_1.txt new file mode 100644 index 0000000..5966f8d --- /dev/null +++ b/Tag 2/Aufgaben/Aufgabe_1.txt @@ -0,0 +1,10 @@ +/* + * Erstellen Sie die Klasse "Song" mit den Attributen + * string "titel", string "interpret", int "dauerSekunden" + * passenden Getter und Setter für die Attribute + * und der Methode "Spielen", die auf der Konsole alle Informationen über den Song ausgibt (die Dauer dabei in Minuten und Sekunden, z.B. 03:35). + * + * Über einen Konstruktor sollen die Attribute initialisiert werden. + * + * Erstellen Sie in der Main einen Song und rufen Sie die Methode auf. + */ \ No newline at end of file diff --git a/Tag 2/Aufgaben/Aufgabe_2.txt b/Tag 2/Aufgaben/Aufgabe_2.txt new file mode 100644 index 0000000..2e4ccb5 --- /dev/null +++ b/Tag 2/Aufgaben/Aufgabe_2.txt @@ -0,0 +1,14 @@ +/* + * Sie bauen einen Roboter. Erstellen Sie die Klasse Robot mit folgenden öffentlichen Membern: + * - Integer "batterieLaufzeit" + * - String "aufgabe" + * - Methode "IstBatterieLaufzeitNiedrig" + * gibt true zurück, wenn die Laufzeit kleiner 2 ist, sonst false. + * - Methode "FühreAufgabeAus" + * gibt auf dem Bildschirm den Text des Attributs "aufgabe" aus, wenn "IstBatterieLaufzeitNiedrig" false liefert + * und reduziert dann die Batterielaufzeit um 1, + * sonst soll "Ich muss aufgeladen werden." in der Konsole erscheinen. + * + * Erstellen Sie in der Main einen Roboter mit der Aufgabe "Ich reiche Butter." und einer Batterielaufzeit von 5. + * Lassen Sie ihn fünfmal in einer Schleife Butter reichen. + */ \ No newline at end of file diff --git a/Tag 2/Aufgaben/Aufgabe_3.txt b/Tag 2/Aufgaben/Aufgabe_3.txt new file mode 100644 index 0000000..8cb6b7c --- /dev/null +++ b/Tag 2/Aufgaben/Aufgabe_3.txt @@ -0,0 +1,15 @@ +/* Komplexe Aufgabenstellung: + * Sie sollen eine Anwendung für einen Shop schreiben. Im Shop gibt es viele Artikel, die mit Id, Bezeichnung, Einkaufspreis, Gewinnsatz und Verkaufspreis gespeichert werden. Der Verkaufspreis wird dabei immer aus Einkaufspreis + Gewinn errechnet. + * + * Artikel, die gekauft werden, werden mit Mengenangabe in einen Warenkorb gelegt. Es sollen Artikel in den Warenkorb gelegt und wieder entfernt werden können. Ebenfalls soll es möglich sein, die Anzahl eines Artikels ändern zu können. Über den Warenkorb wird der Gesamtpreis aller sich dort befindenden Artikel ermittelt. + * + * Artikel im Warenkorb werden dort als Warenkorb-Items eingetragen. Ein Warenkorb-Item besteht aus dem Artikel selbst und der Anzahl. Ebenfalls soll der Gesamtpreis für diesen Artikel abgefragt werden können. + * + + + * Es ist nicht erforderlich, ein Eingabe-Menü zu basteln. Es reicht, die einzelnen Fälle über Code in der Main zu testen. + * Wichtig für diese Übung: Beachten Sie die Prinzipien der OOP. Insbesondere die Klassenbildung und Datenkapselung / Geheimnisprinzip. + * Ebenso sollen Sie die strikte Trennung von Funktionalität / Datenhaltung und Darstellung beachten. Heißt: Dort, wo die Daten gespeichert sind und Funktionalitäten liegen, wird KEINE Konsolenausgabe getätigt. Konsolenausgaben nur in dafür vorgesehenen eigenen Klassen oder zum Beispiel in der Main. + * Diese Aufgabe lässt sich mit dem lösen, was wir bisher kennengelernt haben. + * Erstellen Sie auch ein UML Klassendiagramm und gerne auch Anwendungsfall-, Sequenz- oder Aktivitätsdiagramm. + */ \ No newline at end of file diff --git a/Tag 2/Aufgaben/Aufgaben.csproj b/Tag 2/Aufgaben/Aufgaben.csproj new file mode 100644 index 0000000..ed9781c --- /dev/null +++ b/Tag 2/Aufgaben/Aufgaben.csproj @@ -0,0 +1,10 @@ + + + + Exe + net10.0 + enable + enable + + + diff --git a/Tag 2/Aufgaben/Lösung_1/Lösung_1.txt b/Tag 2/Aufgaben/Lösung_1/Lösung_1.txt new file mode 100644 index 0000000..1a72ca8 --- /dev/null +++ b/Tag 2/Aufgaben/Lösung_1/Lösung_1.txt @@ -0,0 +1,13 @@ +using System; + +namespace Lösungen +{ + class Program + { + public static void Main(string[] args) + { + Song s = new Song("Rip & Tear", "Mick Gordon", 258); + s.Spielen(); + } + } +} \ No newline at end of file diff --git a/Tag 2/Aufgaben/Lösung_1/Song.txt b/Tag 2/Aufgaben/Lösung_1/Song.txt new file mode 100644 index 0000000..9f39b85 --- /dev/null +++ b/Tag 2/Aufgaben/Lösung_1/Song.txt @@ -0,0 +1,35 @@ +/* + * Erstellen Sie die Klasse "Song" mit den Attributen + * string "titel", string "interpret", int "dauerSekunden" + * passenden Getter und Setter für die Attribute + * und der Methode "spielen", die auf der Konsole alle Informationen über den Song ausgibt (die Dauer dabei in Minuten und Sekunden, z.B. 03:35). + * + * Über einen Konstruktor sollen die Attribute initialisiert werden. + * + * Erstellen Sie in der Main einen Song und rufen Sie die Methode auf. + */ + +using System; + +namespace Lösungen +{ + internal class Song + { + public string Titel { get; } + public string Interpret { get; } + public int DauerSekunden { get; } + + + public Song(string titel, string interpret, int dauerSekunden) + { + Titel = titel; + DauerSekunden = dauerSekunden; + Interpret = interpret; + } + + public void Spielen() + { + Console.WriteLine($"{Titel} - {Interpret} - {DauerSekunden/60:D2}:{DauerSekunden%60:D2}"); + } + } +} diff --git a/Tag 2/Aufgaben/Lösung_2/Lösung_2.txt b/Tag 2/Aufgaben/Lösung_2/Lösung_2.txt new file mode 100644 index 0000000..9dca3f3 --- /dev/null +++ b/Tag 2/Aufgaben/Lösung_2/Lösung_2.txt @@ -0,0 +1,32 @@ +/* + * Sie bauen einen Roboter. Erstellen Sie die Klasse Robot mit folgenden öffentlichen Membern: + * - Integer "batterieLaufzeit" + * - String "aufgabe" + * - Methode "IstBatterieLaufzeitNiedrig" + * gibt true zurück, wenn die Laufzeit kleiner 2 ist, sonst false. + * - Methode "FühreAufgabeAus" + * gibt auf dem Bildschirm den Text des Attributs "aufgabe" aus, wenn "IstBatterieLaufzeitNiedrig" false liefert + * und reduziert dann die Batterielaufzeit um 1, + * sonst soll "Ich muss aufgeladen werden." in der Konsole erscheinen. + * + * Erstellen Sie in der Main einen Roboter mit der Aufgabe "Ich reiche Butter." und einer Batterielaufzeit von 5. + * Lassen Sie ihn fünfmal in einer Schleife Butter reichen. + */ + +using System; + +namespace Lösungen +{ + class Lösung_2 + { + + public static void Main(String[] args) + { + Robot r = new Robot(5, "Ich reiche Butter."); + + for (int i = 0; i < 5; i++) + r.FühreAufgabeAus(); + } + + } +} \ No newline at end of file diff --git a/Tag 2/Aufgaben/Lösung_2/Robot.txt b/Tag 2/Aufgaben/Lösung_2/Robot.txt new file mode 100644 index 0000000..21e8738 --- /dev/null +++ b/Tag 2/Aufgaben/Lösung_2/Robot.txt @@ -0,0 +1,32 @@ +using System; + +namespace Lösungen +{ + class Robot + { + private int batterieLaufzeit; + private string aufgabe; + + public Robot(int batterieLaufzeit, string aufgabe) + { + this.batterieLaufzeit = batterieLaufzeit; + this.aufgabe = aufgabe; + } + + public bool IstBatterieLaufzeitNiedrig() + { + return batterieLaufzeit < 2; + } + + public void FühreAufgabeAus() + { + if (!IstBatterieLaufzeitNiedrig()) + { + Console.WriteLine(aufgabe); + batterieLaufzeit--; + } + else + Console.WriteLine("Ich muss aufgeladen werden."); + } + } +} diff --git a/Tag 2/Aufgaben/Lösung_3/Artikel.txt b/Tag 2/Aufgaben/Lösung_3/Artikel.txt new file mode 100644 index 0000000..82c0bb8 --- /dev/null +++ b/Tag 2/Aufgaben/Lösung_3/Artikel.txt @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; + +class Artikel +{ + /// + /// In dieser Liste werden alle Artikel abgespeichert. + /// + public static readonly List artikelListe = new List(); + + private int id; // privates Feld + + /// + /// Die ID des Artikels. + /// + public int Id // Dazugehöriger, öffentlicher Getter + { + get => id; + } + + private string bezeichnung; + + /// + /// Die Bezeichnung des Artikels. + /// + public string Bezeichnung + { + get => bezeichnung; + } + + private double einkaufspreis; + + /// + /// Der Einkaufspreis des Artikels, muss größer 0 sein. + /// + public double Einkaufspreis + { + get => einkaufspreis; // Getter + set // Setter + { + if (value > 0) // If-Bedingung im Setter, prüft, ob der übergebene Wert größer 0 ist und weist nur dann einkaufspreis den Wert zu. + einkaufspreis = value; + } + } + + + private int gewinnsatz; + + /// + /// Der Gewinnsatz des Artikels. + /// + public int Gewinnsatz + { + get => gewinnsatz; // Getter + set => gewinnsatz = value; // Setter + } + + + /// + /// Gibt den Verkaufspreis des Artikels zurück. Berechnet aus Einkaufspreis + Gewinnsatz. + /// + public double Verkaufspreis + { + get => Math.Round(einkaufspreis + (einkaufspreis / 100.0 * gewinnsatz), 2); + } + + /// + /// Sucht in der ArtikelListe nach dem Artikel mit der übergebenen ID und gibt diesen zurück. + /// + /// artikelId Die ID des gesuchten Artikels. + /// Den gesuchten Artikel oder null. + public static Artikel? getArtikel(int artikelId) + { + foreach (Artikel artikel in artikelListe) + { + if (artikel.id == artikelId) + return artikel; + } + return null; + } + + /// + /// Gibt einen String mit Informationen über den Artikel zurück. + /// + /// Einen string aus Id, Bezeichnung und Verkaufspreis. + public String GetArtikelString() + { + return String.Format($"ID : {id} - Bezeichnung: {bezeichnung} - Einzelpreis: {Verkaufspreis:C2}"); + } + + /// + /// Instanziiert einen Artikel und fügt ihn der ArtikelListe hinzu. + /// + /// ID des Artikels + /// Bezeichnung des Artikels + /// Einkaufspreis des Artikels - muss größer 0 sein + /// Gewinnsatz des Artikels + public Artikel(int id, String bezeichnung, double einkaufspreis, int gewinnsatz) + { + this.id = id; // Zuweisung über privates Feld + this.bezeichnung = bezeichnung; + Einkaufspreis = einkaufspreis; // Zuweisung über den Setter, da sich dort eine Überprüfung des Wertes auf größer 0 befindet + Gewinnsatz = gewinnsatz; + + artikelListe.Add(this); // Fügt die aktuelle Instanz / das aktuelle Objekt der Liste hinzu. + } +} + diff --git a/Tag 2/Aufgaben/Lösung_3/Class.dia b/Tag 2/Aufgaben/Lösung_3/Class.dia new file mode 100644 index 0000000000000000000000000000000000000000..3e71386aab5733ce4f49e71fd1d387c4699bcac3 GIT binary patch literal 2326 zcmV+x3F-D9iwFP!000023+-K7bE`%Yem}p0(y7WrVq-vHNpb8{l1*|>Rkrpao83p% z03$Rp4BBC^kDS{5WqHdV+u9neR5gPiNOLxyVL-**LZ$Eji^nh7Fe0n=k zWo05^YWX&y&h6y4fBtkipL~1w?i-t+uf>nUkSB>dXb`=-ovbK& z$u0@y0AKwNxh}dAg{~%d?T}!Vb&KWU7jwOmbd^<6bb?-1gr1m5!m6o%7 z*JsiLa&IT^SMh6dm5RB_$T=c=gB)x!jPA=tE8?|Sv=P0*>`<(?@dF}?@a-m7q(n~i z`$d_wR3Hjb=kEP?`un6x>4j%mMHMXt;T~cRp?Mt9H*V4qnmpGuO>~B_m@kx>K2vvn z(j3kl7tS3Qj*SaPg5}0%oFT&Vkf!gu7|{fkvkV59l;;Dp4+L4}%S%all3r^T+Sdi}6m-Hu5v9Zc3Sgp0PArQ$z` zp~K8!(L61sBb>S%30a&x?B2cT6yN+ETRd&;Z-4(qx|Du!Q4ma?8HnH?#J-*UL&?J8-{~mx&I&-9Lg6o z8gbz+27}toST!4!C0cEOYBs4mP^xc(_1q&vo8em%qo9>A&!x3SIXAg?lDg7Pe%eb* zL4fhn#nj1r$YxRLR<79buuLBY{p~A;2vZ`cXY6q|^gDP2KD=kN6MO?QUA-g}& z41wcMeAqTnUo08j<;u_d{pgysLLPCqw-e8&ey~B7U{nF$M)XRsqeR3He#i)B?eKSV z!t2#w^@*lEOhz3@7f&)qiuEawdv-M zUI+b!O;j>QL9P$nmEMmUj)$Bv!SP_TI#!9R_NvlD!M#-68eMt4$iA*yHnNl&9xm%c z&)pZ!?|@Y9{}!)pej#FUQnD9(WCNva&dV-wa-b2~7cRd^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000000..e501ef0 --- /dev/null +++ b/Tag 2/Aufgaben/Lösung_3/Lösung_3.txt @@ -0,0 +1,114 @@ +/* Komplexe Aufgabenstellung: + * Sie sollen eine Anwendung für einen Shop schreiben. Im Shop gibt es viele Artikel, die mit Id, Bezeichnung, Einkaufspreis, Gewinnsatz und Verkaufspreis gespeichert werden. Der Verkaufspreis wird dabei immer aus Einkaufspreis + Gewinn errechnet. + * + * Artikel, die gekauft werden, werden mit Mengenangabe in einen Warenkorb gelegt. Es sollen Artikel in den Warenkorb gelegt und wieder entfernt werden können. Ebenfalls soll es möglich sein, die Anzahl eines Artikels ändern zu können. Über den Warenkorb wird der Gesamtpreis aller sich dort befindenden Artikel ermittelt. + * + * Artikel im Warenkorb werden dort als Warenkorb-Items eingetragen. Ein Warenkorb-Item besteht aus dem Artikel selbst und der Anzahl. Ebenfalls soll der Gesamtpreis für diesen Artikel abgefragt werden können. + * + * Es ist nicht erforderlich, ein Eingabe-Menü zu basteln. Es reicht, die einzelnen Fälle über Code in der Main zu testen. + * Wichtig für diese Übung: Beachten Sie die Prinzipien der OOP. Insbesondere die Klassenbildung und Datenkapselung / Geheimnisprinzip. + * Ebenso sollen Sie die strikte Trennung von Funktionalität / Datenhaltung und Darstellung beachten. Heißt: Dort, wo die Daten gespeichert sind und Funktionalitäten liegen, wird KEINE Konsolenausgabe getätigt. Konsolenausgaben nur in dafür vorgesehenen eigenen Klassen oder zum Beispiel in der Main. + * Diese Aufgabe lässt sich mit dem lösen, was wir bisher kennengelernt haben. + * Erstellen Sie auch ein UML Klassendiagramm und gerne auch Anwendungsfall-, Sequenz- oder Aktivitätsdiagramm. + */ + +using System; +using System.Text; + +namespace Lösungen +{ + class Lösung_3 + { + + public static void Main(String[] args) + { + Console.OutputEncoding = Encoding.UTF8; + + // Drei Artikel erstellen + new Artikel(1, "Artikel 1", 99.99, 20); + new Artikel(2, "Artikel 2", 49.99, 25); + new Artikel(3, "Artikel 3", 9.99, 15); + + foreach (Artikel artikel in Artikel.artikelListe) + { + Console.WriteLine(artikel.GetArtikelString()); + } + + Console.WriteLine(); + + // Neuen Warenkorb erstellen + Warenkorb warenkorb = new Warenkorb(); + + // Artikel zum Warenkorb hinzufügen + Hinzufügen(warenkorb, 1, 2); // Zum Hinzufügen und Entfernen habe ich hier noch zwei extra Methoden geschrieben, um in der Main doppelten Code zu vermeiden (also das If-Else mit den Ausgaben ausgelagert) + + // Warenkorb ausgeben + Console.WriteLine(warenkorb.GetWarenkorbString()); + + Hinzufügen(warenkorb, 3, 20); + + Console.WriteLine(warenkorb.GetWarenkorbString()); + + // Artikel entfernen (Anzahl verringern) + Entfernen(warenkorb, 3, 10); + + Console.WriteLine(warenkorb.GetWarenkorbString()); + + // Artikel hinzufügen (Anzahl erhöhen) + Hinzufügen(warenkorb, 3, 5); + + Console.WriteLine(warenkorb.GetWarenkorbString()); + + // Artikel komplett entfernen + Entfernen(warenkorb, 3, 20); + + Console.WriteLine(warenkorb.GetWarenkorbString()); + + // Entfernten Artikel erneut hinzufügen + Hinzufügen(warenkorb, 3, 1); + + Console.WriteLine(warenkorb.GetWarenkorbString()); + + // Artikel entfernen, der nicht im Warenkorb ist + Entfernen(warenkorb, 2, 10); + + Console.WriteLine(warenkorb.GetWarenkorbString()); + + // Artikel hinzufügen, der nicht existiert + Hinzufügen(warenkorb, 4, 1); + + Console.WriteLine(warenkorb.GetWarenkorbString()); + + // Alle Artikel entfernen + Entfernen(warenkorb, 1, 2); + Entfernen(warenkorb, 3, 1); + + Console.WriteLine(warenkorb.GetWarenkorbString()); + + } + + /** + * Methode zum Hinzufügen von Artikeln. Konsolenausgabe entsprechend dem Ergebnis. + */ + static void Hinzufügen(Warenkorb warenkorb, int artikelId, int anzahl) + { + if (warenkorb.ArtikelHinzufügen(artikelId, anzahl)) + Console.WriteLine("Hinzufügen erfolgreich!"); + else + Console.WriteLine("Hinzufügen fehlgeschlagen!"); + } + + + /** + * Methode zum Entfernen von Artikeln. Konsolenausgabe entsprechend dem Ergebnis. + */ + static void Entfernen(Warenkorb warenkorb, int artikelId, int anzahl) + { + if (warenkorb.ArtikelEntfernen(artikelId, anzahl)) + Console.WriteLine("Entfernen erfolgreich!"); + else + Console.WriteLine("Entfernen fehlgeschlagen!"); + } + + } +} \ No newline at end of file diff --git a/Tag 2/Aufgaben/Lösung_3/UseCase.dia b/Tag 2/Aufgaben/Lösung_3/UseCase.dia new file mode 100644 index 0000000000000000000000000000000000000000..a5aede3424cf7ab8cb93a2599a7d125d2ea5e820 GIT binary patch literal 2148 zcmV-q2%GmGiwFP!000023+-Ina@#l(efL+elvf4D9bh!}RAy=}53{pdwUgRM7bL+F zHx#KNAz$WUK5Ktqery|*Wa~m%5-BQnLRQ5NX$S{sG`deWn)>ehhe;gV*({IJf7PTRb(+Wl?|TY>=3Vz3TMM;PWU;XUVWLZ?$MQ zNaHjM?o52ud3Re}oy$cxmuvmJ(D&4gY(KN+^X{%OTwz$H>#5B)yPZtaJc1_fak|xH zM?e1ON}ENi92zB~>vtddyZMk751#uf8|Y3DH!;~LO15!8Ht}2#6lqE+2t$NA#EL7j zl*#dM{qw@b=Y`A83m4@#(=>CLiQG11KTTt6k~yl&X0|#`J}@z;*h|x@F^k*CxpdF? zZ%v#ZGJ*Nyr`>k!&K+gZ@a2uW)?!C5_tDUeZyp*F*Sz<~hI+q?@~9u%ve8G0J6ZRS zr|EukbqeeK{PCLFFz;=rdl+gftT^61jAqf$=6lp^z0HoE#*1c``=q|v?oh$ZA8k16 z0wOk#Hd}Q6D=eMOMw$21!D59MCMPfh7u_xIR)muF|7!`JSq*<~}4^B0m0-~@Y+f#b-QX!H&T)k>wjcqgMI;*Bd;+nx zeI8Z>1A=G|-+DE7dI9Er@hsa`f%O0m<7yDMQ5+utu^xUN2jT34+o!=BZFZTWA_QD( zw-GJ=V3V2q(`Gwj#utdzF8QR1D+Bb;gIhC+;zt;lN%BsRyGKt5z)UUpf{pL2iw0(u zxEw!%EzK^~IK829ydLPf0o`dt!K~r19@0AdJW#`{06}awN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uXT%diigCj)UJ@YQ9*HofdW3=} zV7hRaqz1V@xT3v$o+VAG*JU|pC*+$dX$SJyY(2^!-UF%W$vJ)!h3@izMM zL{}wb=k%Ga4{Y2AmZ@NSaC_8_xGRRVxhI~7!cI^fb$~gNCoo4$bQR(a zTO$AgVjSmc@*U;qFf*&`(Y literal 0 HcmV?d00001 diff --git a/Tag 2/Aufgaben/Lösung_3/Warenkorb.txt b/Tag 2/Aufgaben/Lösung_3/Warenkorb.txt new file mode 100644 index 0000000..d1be940 --- /dev/null +++ b/Tag 2/Aufgaben/Lösung_3/Warenkorb.txt @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.Text; + +class Warenkorb +{ + /** + * Eine Liste aller Artikel im Warenkorb. + */ + private List itemListe = new List(); + + /** + * Gibt den Gesamtpreis aller Artikel im Warenkorb zurück. + */ + public double Gesamtpreis // Als Property (Eigenschaft) + { + get + { + double summe = 0; + foreach (WarenkorbItem item in itemListe) + { + summe += item.ItemPreis; + } + + return summe; + } + } + + /** + * Fügt einen über die Artikel-ID identifizierten Artikel mit einer gewünschten Anzahl dem Warenkorb hinzu. Befindet sich der Artikel bereits im Warenkorb, wird die Anzahl erhöht. + *
Gibt true zurück, wenn erfolgreich, sonst false. + * @param artikelId Die ID des Artikels. + * @param anzahl Die gewünschte Anzahl. + * @return True wenn erfolgreich, sonst False. + */ + public bool ArtikelHinzufügen(int artikelId, int anzahl) + { + // Sucht in der ArtikelListe der Klasse Artikel nach dem Objekt mit der passenden artikelID und gibt den Artikel zurück, wenn er gefunden wurde, sonst null. + Artikel? artikel = Artikel.getArtikel(artikelId); + // Und wenn der Artikel gefunden wurde... + return ArtikelHinzufügen(artikel, anzahl); // Aufruf der zweiten 'ArtikelHinzufügen' Methode + } + + /** + * Fügt einen Artikel mit einer gewünschten Anzahl dem Warenkorb hinzu. Befindet sich der Artikel bereits im Warenkorb, wird die Anzahl erhöht. + *
Gibt true zurück, wenn erfolgreich, sonst false. + * @param artikel Der Artikel. + * @param anzahl Die gewünschte Anzahl. + * @return True wenn erfolgreich, sonst False. + */ + public bool ArtikelHinzufügen(Artikel? artikel, int anzahl) + { + if (artikel != null) + { + // dann prüfen wir, ob der gesuchte Artikel bereits im Warenkorb ist, indem wir uns jedes Item im Warenkorb anschauen... + foreach (WarenkorbItem item in itemListe) + { + // und wenn ein Item im Warenkorb dem gefundenen Artikel entspricht... + if (item.Item == artikel) + { + // dann erhöhen wir einfach die Anzahl + item.Anzahl = item.Anzahl + anzahl; + return true; + } + } + // Sonst fügen wir den Artikel neu dem Warenkorb hinzu + itemListe.Add(new WarenkorbItem(artikel, anzahl)); + return true; + } + // Wenn wir keinen Artikel mit der artikelId gefunden haben, geben wir false zurück + return false; + } + + /** + * Entfernt einen Artikel aus dem Warenkorb. + */ + public bool ArtikelEntfernen(int artikelId, int anzahl) + { + // Sucht in der ArtikelListe der Klasse Artikel nach dem Objekt mit der passenden artikelID und gibt den Artikel zurück, wenn er gefunden wurde, sonst null. + Artikel? artikel = Artikel.getArtikel(artikelId); + // Und wenn der Artikel gefunden wurde... + return ArtikelEntfernen(artikel, anzahl); + } + + /** + * Entfernt einen Artikel aus dem Warenkorb. + */ + public bool ArtikelEntfernen(Artikel? artikel, int anzahl) + { + if (artikel != null) + { + foreach (WarenkorbItem item in itemListe) + { + // und wenn ein Item im Warenkorb dem Artikel entspricht... + if (item.Item == artikel) + { + // wenn die verbleibende Anzahl kleiner gleich 0 ist + if (item.Anzahl - anzahl <= 0) + { + // dann entfernen wir den Artikel komplett aus dem Warenkorb + itemListe.Remove(item); + } + // Sonst verringern wir die Anzahl im Warenkorb um die gewünschte Anzahl + else + { + item.Anzahl = item.Anzahl - anzahl; + } + + return true; + } + } + + // Wenn sich der Artikel nicht im Warenkorb befindet... + return false; + } + + // Wenn der Artikel nicht gefunden wurde... + return false; + } + + + /** + * Gibt einen String mit Informationen zu allen Artikeln im Warenkorb zurück, inklusive der Summe. + */ + public string GetWarenkorbString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("Aktueller Warenkorb: \n"); + + // Ruft für jedes Item im Warenkorb die GetWarenkorbItemString-Methode auf... + foreach (WarenkorbItem item in itemListe) + { + // und fügt den Rückgabewert dem String hinzu + sb.Append(item.GetWarenkorbItemString()).Append("\n"); + } + sb.Append(String.Format($"Summe: {Gesamtpreis:C2}")); + return sb.ToString(); + } + +} + diff --git a/Tag 2/Aufgaben/Lösung_3/WarenkorbItem.txt b/Tag 2/Aufgaben/Lösung_3/WarenkorbItem.txt new file mode 100644 index 0000000..b6e51cb --- /dev/null +++ b/Tag 2/Aufgaben/Lösung_3/WarenkorbItem.txt @@ -0,0 +1,58 @@ +using System; + +class WarenkorbItem +{ + private Artikel item; + + /** + * Der sich im Warenkorb befindende Artikel. + */ + public Artikel Item + { + get => item; + } + + private int anzahl; + + /** + * Die Anzahl, wie oft der Artikel im Warenkorb liegt. Anzahl muss größer 0 sein. + */ + public int Anzahl + { + get => anzahl; + set + { + if (value > 0) + anzahl = value; + } + } + + + /** + * Gibt den Gesamtpreis des Artikels zurück. Berechnet durch Verkaufspreis * Anzahl. + */ + public double ItemPreis + { + get => item.Verkaufspreis * anzahl; + } + + /** + * Gibt einen String mit Informationen über den Artikel im Warenkorb zurück. + * @return Einen String aus Id, Bezeichnung, Verkaufspreis, Anzahl und Gesamtpreis. + */ + public string GetWarenkorbItemString() + { + return String.Format(item.GetArtikelString() + $" - Anzahl: {anzahl} - Gesamtpreis: {ItemPreis:C2}"); + } + + /** + * Instanziiert ein neues Warenkorb-Item. + * @param item Der Artikel im Warenkorb. + * @param anzahl Die Anzahl, wie oft sich der Artikel im Warenkorb befindet. + */ + public WarenkorbItem(Artikel item, int anzahl) + { + this.item = item; + Anzahl = anzahl; + } +} \ No newline at end of file diff --git a/Tag 2/Aufgaben/Lösung_3v2/Artikel.txt b/Tag 2/Aufgaben/Lösung_3v2/Artikel.txt new file mode 100644 index 0000000..06885cb --- /dev/null +++ b/Tag 2/Aufgaben/Lösung_3v2/Artikel.txt @@ -0,0 +1,31 @@ + +namespace Lösungen +{ + internal class Artikel + { + public int Id { get; } // Property mit unsichtbarem Backing-Field + public string Bezeichnung { get; set; } + public double Einkaufspreis { get; set; } + public int Gewinnsatz { get; set; } + public double Verkaufspreis // Full-Property, aber ohne Backing-Field, da der Wert jedes Mal über den Getter neu berechnet wird. + { + get + { + return Einkaufspreis + (Einkaufspreis * Gewinnsatz / 100); + } + } + + public Artikel(int id, string bezeichnung, double einkaufspreis, int gewinnsatz) + { + Id = id; + Bezeichnung = bezeichnung; + Einkaufspreis = einkaufspreis; + Gewinnsatz = gewinnsatz; + } + + public override string ToString() + { + return $"{Id} {Bezeichnung}: {Einkaufspreis:C2} + {Gewinnsatz} % = {Verkaufspreis:C2}"; + } + } +} \ No newline at end of file diff --git a/Tag 2/Aufgaben/Lösung_3v2/Program.txt b/Tag 2/Aufgaben/Lösung_3v2/Program.txt new file mode 100644 index 0000000..3867ad2 --- /dev/null +++ b/Tag 2/Aufgaben/Lösung_3v2/Program.txt @@ -0,0 +1,42 @@ +/* Komplexe Aufgabenstellung: + * Sie sollen eine Anwendung für einen Shop schreiben. Im Shop gibt es viele Artikel, die mit Id, Bezeichnung, Einkaufspreis, Gewinnsatz und Verkaufspreis gespeichert werden. Der Verkaufspreis wird dabei immer aus Einkaufspreis + Gewinn errechnet. + * + * Artikel, die gekauft werden, werden mit Mengenangabe in einen Warenkorb gelegt. Es sollen Artikel in den Warenkorb gelegt und wieder entfernt werden können. Ebenfalls soll es möglich sein, die Anzahl eines Artikels ändern zu können. Über den Warenkorb wird der Gesamtpreis aller sich dort befindenden Artikel ermittelt. + * + * Artikel im Warenkorb werden dort als Warenkorb-Items eingetragen. Ein Warenkorb-Item besteht aus dem Artikel selbst und der Anzahl. Ebenfalls soll der Gesamtpreis für diesen Artikel abgefragt werden können. + * + */ + +using System; +using System.Text; + +namespace Lösungen +{ + internal class Program + { + public static void Main(String[] args) + { + Console.OutputEncoding = Encoding.UTF8; + + Artikel a1 = new Artikel(1, "Apfel", 0.30, 10); + Artikel a2 = new Artikel(2, "Flatscreen", 75.0, 30); + Artikel a3 = new Artikel(3, "Blumentopf", 0.50, 80); + + Warenkorb w = new Warenkorb(); + + Console.WriteLine(w.ArtikelHinzufügen(a1)); + Console.WriteLine(w.ToString()); + Console.WriteLine(w.ArtikelHinzufügen(a1, 9)); + Console.WriteLine(w.ToString()); + Console.WriteLine(w.ArtikelEntfernen(a2, 1)); + Console.WriteLine(w.ToString()); + Console.WriteLine(w.ArtikelHinzufügen(a2, 10)); + Console.WriteLine(w.ToString()); + Console.WriteLine(w.ArtikelEntfernen(a2, 9)); + Console.WriteLine(w.ToString()); + //Console.WriteLine(w.ArtikelHinzufügen(null, 1)); + //Console.WriteLine(w.ToString()); + + } + } +} diff --git a/Tag 2/Aufgaben/Lösung_3v2/Warenkorb.txt b/Tag 2/Aufgaben/Lösung_3v2/Warenkorb.txt new file mode 100644 index 0000000..d74ccae --- /dev/null +++ b/Tag 2/Aufgaben/Lösung_3v2/Warenkorb.txt @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Lösungen +{ + internal class Warenkorb + { + private List warenkorbItemListe = new List(); + + + public bool ArtikelHinzufügen(Artikel artikel, ushort anzahl = 1) // durch 'ushort' verhindern wir negative Werte und '= 1' ist ein Default-Wert, womit das Argument beim Aufruf weggelassen werden kann. + { + if (artikel == null) + throw new ArgumentNullException(nameof(artikel)); + + try + { + // Wir suchen nach einem WarenkorbItem, in dem der Artikel der übergebene Artikel ist. + WarenkorbItem? item = warenkorbItemListe.Find(x => x.Artikel == artikel); + + if (item == null) // Wenn wir keinen finden... + { + item = new WarenkorbItem(artikel, anzahl); // erzeugen wir einen neuen. + warenkorbItemListe.Add(item); + return true; + } + else // Sonst... + { + item.Anzahl = (ushort)(item.Anzahl + anzahl); // erhöhen wir die Anzahl. + return true; + } + } + catch (Exception) + { + return false; // Kommt es dabei zu einem Fehler, geben wir false zurück. + } + + } + + public bool ArtikelEntfernen(Artikel artikel, ushort anzahl) + { + if (artikel == null) + throw new ArgumentNullException(nameof(artikel)); + + try + { + // Wir suchen nach einem WarenkorbItem, in dem der Artikel der übergebene Artikel ist. + WarenkorbItem? item = warenkorbItemListe.Find(x => x.Artikel == artikel); + + if (item != null) // Haben wir ihn gefunden... + { + item.Anzahl = (ushort)(item.Anzahl - anzahl); // reduzieren wir die Anzahl. + if (item.Anzahl <= 0) // Ist die Anzahl 0 oder weniger, + warenkorbItemListe.Remove(item); // nehmen wir den Artikel ganz aus dem Warenkorb. + + return true; + } + else // Haben wir keinen gefunden... + { + return false; // geben wir false zurück. + } + } + catch (Exception) + { + return false; + } + } + + public double GetGesamtpreis() + { + double summe = 0; + foreach (WarenkorbItem item in warenkorbItemListe) + { + summe += item.Gesamtpreis; + } + return summe; + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + + foreach (WarenkorbItem item in warenkorbItemListe) + { + sb.AppendLine(item.ToString()); + } + + sb.AppendLine($"{GetGesamtpreis():C2}"); + + return sb.ToString(); + } + + } +} diff --git a/Tag 2/Aufgaben/Lösung_3v2/WarenkorbItem.txt b/Tag 2/Aufgaben/Lösung_3v2/WarenkorbItem.txt new file mode 100644 index 0000000..ae1f150 --- /dev/null +++ b/Tag 2/Aufgaben/Lösung_3v2/WarenkorbItem.txt @@ -0,0 +1,22 @@ + +namespace Lösungen +{ + internal class WarenkorbItem + { + public Artikel Artikel { get; } + public ushort Anzahl { get; set; } + + public double Gesamtpreis => Artikel.Verkaufspreis * Anzahl; // Property als Expression-Bodied-Member + + public WarenkorbItem(Artikel artikel, ushort anzahl) + { + Artikel = artikel; + Anzahl = anzahl; + } + + public override string ToString() + { + return Artikel.ToString() + $" , * {Anzahl} = {Gesamtpreis:C2}"; + } + } +} diff --git a/Tag 2/Aufgaben/Program.cs b/Tag 2/Aufgaben/Program.cs new file mode 100644 index 0000000..3751555 --- /dev/null +++ b/Tag 2/Aufgaben/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); diff --git a/Tag 2/Aufgaben/obj/Aufgaben.csproj.nuget.dgspec.json b/Tag 2/Aufgaben/obj/Aufgaben.csproj.nuget.dgspec.json new file mode 100644 index 0000000..2b32553 --- /dev/null +++ b/Tag 2/Aufgaben/obj/Aufgaben.csproj.nuget.dgspec.json @@ -0,0 +1,342 @@ +{ + "format": 1, + "restore": { + "/home/wbs/Dokumente/Programmierung/wbs-csharp/Tag 2/Aufgaben/Aufgaben.csproj": {} + }, + "projects": { + "/home/wbs/Dokumente/Programmierung/wbs-csharp/Tag 2/Aufgaben/Aufgaben.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/wbs/Dokumente/Programmierung/wbs-csharp/Tag 2/Aufgaben/Aufgaben.csproj", + "projectName": "Aufgaben", + "projectPath": "/home/wbs/Dokumente/Programmierung/wbs-csharp/Tag 2/Aufgaben/Aufgaben.csproj", + "packagesPath": "/home/wbs/.nuget/packages/", + "outputPath": "/home/wbs/Dokumente/Programmierung/wbs-csharp/Tag 2/Aufgaben/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/wbs/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net10.0" + ], + "sources": { + "/usr/lib64/dotnet/library-packs": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net10.0": { + "targetAlias": "net10.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "all" + }, + "SdkAnalysisLevel": "10.0.100" + }, + "frameworks": { + "net10.0": { + "targetAlias": "net10.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/lib64/dotnet/sdk/10.0.110/PortableRuntimeIdentifierGraph.json", + "packagesToPrune": { + "Microsoft.CSharp": "(,4.7.32767]", + "Microsoft.VisualBasic": "(,10.4.32767]", + "Microsoft.Win32.Primitives": "(,4.3.32767]", + "Microsoft.Win32.Registry": "(,5.0.32767]", + "runtime.any.System.Collections": "(,4.3.32767]", + "runtime.any.System.Diagnostics.Tools": "(,4.3.32767]", + "runtime.any.System.Diagnostics.Tracing": "(,4.3.32767]", + "runtime.any.System.Globalization": "(,4.3.32767]", + "runtime.any.System.Globalization.Calendars": "(,4.3.32767]", + "runtime.any.System.IO": "(,4.3.32767]", + "runtime.any.System.Reflection": "(,4.3.32767]", + "runtime.any.System.Reflection.Extensions": "(,4.3.32767]", + "runtime.any.System.Reflection.Primitives": "(,4.3.32767]", + "runtime.any.System.Resources.ResourceManager": "(,4.3.32767]", + "runtime.any.System.Runtime": "(,4.3.32767]", + "runtime.any.System.Runtime.Handles": "(,4.3.32767]", + "runtime.any.System.Runtime.InteropServices": "(,4.3.32767]", + "runtime.any.System.Text.Encoding": "(,4.3.32767]", + "runtime.any.System.Text.Encoding.Extensions": "(,4.3.32767]", + "runtime.any.System.Threading.Tasks": "(,4.3.32767]", + "runtime.any.System.Threading.Timer": "(,4.3.32767]", + "runtime.aot.System.Collections": "(,4.3.32767]", + "runtime.aot.System.Diagnostics.Tools": "(,4.3.32767]", + "runtime.aot.System.Diagnostics.Tracing": "(,4.3.32767]", + "runtime.aot.System.Globalization": "(,4.3.32767]", + "runtime.aot.System.Globalization.Calendars": "(,4.3.32767]", + "runtime.aot.System.IO": "(,4.3.32767]", + "runtime.aot.System.Reflection": "(,4.3.32767]", + "runtime.aot.System.Reflection.Extensions": "(,4.3.32767]", + "runtime.aot.System.Reflection.Primitives": "(,4.3.32767]", + "runtime.aot.System.Resources.ResourceManager": "(,4.3.32767]", + "runtime.aot.System.Runtime": "(,4.3.32767]", + "runtime.aot.System.Runtime.Handles": "(,4.3.32767]", + "runtime.aot.System.Runtime.InteropServices": "(,4.3.32767]", + "runtime.aot.System.Text.Encoding": "(,4.3.32767]", + "runtime.aot.System.Text.Encoding.Extensions": "(,4.3.32767]", + "runtime.aot.System.Threading.Tasks": "(,4.3.32767]", + "runtime.aot.System.Threading.Timer": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.unix.Microsoft.Win32.Primitives": "(,4.3.32767]", + "runtime.unix.System.Console": "(,4.3.32767]", + "runtime.unix.System.Diagnostics.Debug": "(,4.3.32767]", + "runtime.unix.System.IO.FileSystem": "(,4.3.32767]", + "runtime.unix.System.Net.Primitives": "(,4.3.32767]", + "runtime.unix.System.Net.Sockets": "(,4.3.32767]", + "runtime.unix.System.Private.Uri": "(,4.3.32767]", + "runtime.unix.System.Runtime.Extensions": "(,4.3.32767]", + "runtime.win.Microsoft.Win32.Primitives": "(,4.3.32767]", + "runtime.win.System.Console": "(,4.3.32767]", + "runtime.win.System.Diagnostics.Debug": "(,4.3.32767]", + "runtime.win.System.IO.FileSystem": "(,4.3.32767]", + "runtime.win.System.Net.Primitives": "(,4.3.32767]", + "runtime.win.System.Net.Sockets": "(,4.3.32767]", + "runtime.win.System.Runtime.Extensions": "(,4.3.32767]", + "runtime.win10-arm-aot.runtime.native.System.IO.Compression": "(,4.0.32767]", + "runtime.win10-arm64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.win10-x64-aot.runtime.native.System.IO.Compression": "(,4.0.32767]", + "runtime.win10-x86-aot.runtime.native.System.IO.Compression": "(,4.0.32767]", + "runtime.win7-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.win7-x86.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.win7.System.Private.Uri": "(,4.3.32767]", + "runtime.win8-arm.runtime.native.System.IO.Compression": "(,4.3.32767]", + "System.AppContext": "(,4.3.32767]", + "System.Buffers": "(,5.0.32767]", + "System.Collections": "(,4.3.32767]", + "System.Collections.Concurrent": "(,4.3.32767]", + "System.Collections.Immutable": "(,10.0.32767]", + "System.Collections.NonGeneric": "(,4.3.32767]", + "System.Collections.Specialized": "(,4.3.32767]", + "System.ComponentModel": "(,4.3.32767]", + "System.ComponentModel.Annotations": "(,4.3.32767]", + "System.ComponentModel.EventBasedAsync": "(,4.3.32767]", + "System.ComponentModel.Primitives": "(,4.3.32767]", + "System.ComponentModel.TypeConverter": "(,4.3.32767]", + "System.Console": "(,4.3.32767]", + "System.Data.Common": "(,4.3.32767]", + "System.Data.DataSetExtensions": "(,4.4.32767]", + "System.Diagnostics.Contracts": "(,4.3.32767]", + "System.Diagnostics.Debug": "(,4.3.32767]", + "System.Diagnostics.DiagnosticSource": "(,10.0.32767]", + "System.Diagnostics.FileVersionInfo": "(,4.3.32767]", + "System.Diagnostics.Process": "(,4.3.32767]", + "System.Diagnostics.StackTrace": "(,4.3.32767]", + "System.Diagnostics.TextWriterTraceListener": "(,4.3.32767]", + "System.Diagnostics.Tools": "(,4.3.32767]", + "System.Diagnostics.TraceSource": "(,4.3.32767]", + "System.Diagnostics.Tracing": "(,4.3.32767]", + "System.Drawing.Primitives": "(,4.3.32767]", + "System.Dynamic.Runtime": "(,4.3.32767]", + "System.Formats.Asn1": "(,10.0.32767]", + "System.Formats.Tar": "(,10.0.32767]", + "System.Globalization": "(,4.3.32767]", + "System.Globalization.Calendars": "(,4.3.32767]", + "System.Globalization.Extensions": "(,4.3.32767]", + "System.IO": "(,4.3.32767]", + "System.IO.Compression": "(,4.3.32767]", + "System.IO.Compression.ZipFile": "(,4.3.32767]", + "System.IO.FileSystem": "(,4.3.32767]", + "System.IO.FileSystem.AccessControl": "(,4.4.32767]", + "System.IO.FileSystem.DriveInfo": "(,4.3.32767]", + "System.IO.FileSystem.Primitives": "(,4.3.32767]", + "System.IO.FileSystem.Watcher": "(,4.3.32767]", + "System.IO.IsolatedStorage": "(,4.3.32767]", + "System.IO.MemoryMappedFiles": "(,4.3.32767]", + "System.IO.Pipelines": "(,10.0.32767]", + "System.IO.Pipes": "(,4.3.32767]", + "System.IO.Pipes.AccessControl": "(,5.0.32767]", + "System.IO.UnmanagedMemoryStream": "(,4.3.32767]", + "System.Linq": "(,4.3.32767]", + "System.Linq.AsyncEnumerable": "(,10.0.32767]", + "System.Linq.Expressions": "(,4.3.32767]", + "System.Linq.Parallel": "(,4.3.32767]", + "System.Linq.Queryable": "(,4.3.32767]", + "System.Memory": "(,5.0.32767]", + "System.Net.Http": "(,4.3.32767]", + "System.Net.Http.Json": "(,10.0.32767]", + "System.Net.NameResolution": "(,4.3.32767]", + "System.Net.NetworkInformation": "(,4.3.32767]", + "System.Net.Ping": "(,4.3.32767]", + "System.Net.Primitives": "(,4.3.32767]", + "System.Net.Requests": "(,4.3.32767]", + "System.Net.Security": "(,4.3.32767]", + "System.Net.ServerSentEvents": "(,10.0.32767]", + "System.Net.Sockets": "(,4.3.32767]", + "System.Net.WebHeaderCollection": "(,4.3.32767]", + "System.Net.WebSockets": "(,4.3.32767]", + "System.Net.WebSockets.Client": "(,4.3.32767]", + "System.Numerics.Vectors": "(,5.0.32767]", + "System.ObjectModel": "(,4.3.32767]", + "System.Private.DataContractSerialization": "(,4.3.32767]", + "System.Private.Uri": "(,4.3.32767]", + "System.Reflection": "(,4.3.32767]", + "System.Reflection.DispatchProxy": "(,6.0.32767]", + "System.Reflection.Emit": "(,4.7.32767]", + "System.Reflection.Emit.ILGeneration": "(,4.7.32767]", + "System.Reflection.Emit.Lightweight": "(,4.7.32767]", + "System.Reflection.Extensions": "(,4.3.32767]", + "System.Reflection.Metadata": "(,10.0.32767]", + "System.Reflection.Primitives": "(,4.3.32767]", + "System.Reflection.TypeExtensions": "(,4.3.32767]", + "System.Resources.Reader": "(,4.3.32767]", + "System.Resources.ResourceManager": "(,4.3.32767]", + "System.Resources.Writer": "(,4.3.32767]", + "System.Runtime": "(,4.3.32767]", + "System.Runtime.CompilerServices.Unsafe": "(,7.0.32767]", + "System.Runtime.CompilerServices.VisualC": "(,4.3.32767]", + "System.Runtime.Extensions": "(,4.3.32767]", + "System.Runtime.Handles": "(,4.3.32767]", + "System.Runtime.InteropServices": "(,4.3.32767]", + "System.Runtime.InteropServices.RuntimeInformation": "(,4.3.32767]", + "System.Runtime.Loader": "(,4.3.32767]", + "System.Runtime.Numerics": "(,4.3.32767]", + "System.Runtime.Serialization.Formatters": "(,4.3.32767]", + "System.Runtime.Serialization.Json": "(,4.3.32767]", + "System.Runtime.Serialization.Primitives": "(,4.3.32767]", + "System.Runtime.Serialization.Xml": "(,4.3.32767]", + "System.Security.AccessControl": "(,6.0.32767]", + "System.Security.Claims": "(,4.3.32767]", + "System.Security.Cryptography.Algorithms": "(,4.3.32767]", + "System.Security.Cryptography.Cng": "(,5.0.32767]", + "System.Security.Cryptography.Csp": "(,4.3.32767]", + "System.Security.Cryptography.Encoding": "(,4.3.32767]", + "System.Security.Cryptography.OpenSsl": "(,5.0.32767]", + "System.Security.Cryptography.Primitives": "(,4.3.32767]", + "System.Security.Cryptography.X509Certificates": "(,4.3.32767]", + "System.Security.Principal": "(,4.3.32767]", + "System.Security.Principal.Windows": "(,5.0.32767]", + "System.Security.SecureString": "(,4.3.32767]", + "System.Text.Encoding": "(,4.3.32767]", + "System.Text.Encoding.CodePages": "(,10.0.32767]", + "System.Text.Encoding.Extensions": "(,4.3.32767]", + "System.Text.Encodings.Web": "(,10.0.32767]", + "System.Text.Json": "(,10.0.32767]", + "System.Text.RegularExpressions": "(,4.3.32767]", + "System.Threading": "(,4.3.32767]", + "System.Threading.AccessControl": "(,10.0.32767]", + "System.Threading.Channels": "(,10.0.32767]", + "System.Threading.Overlapped": "(,4.3.32767]", + "System.Threading.Tasks": "(,4.3.32767]", + "System.Threading.Tasks.Dataflow": "(,10.0.32767]", + "System.Threading.Tasks.Extensions": "(,5.0.32767]", + "System.Threading.Tasks.Parallel": "(,4.3.32767]", + "System.Threading.Thread": "(,4.3.32767]", + "System.Threading.ThreadPool": "(,4.3.32767]", + "System.Threading.Timer": "(,4.3.32767]", + "System.ValueTuple": "(,4.5.32767]", + "System.Xml.ReaderWriter": "(,4.3.32767]", + "System.Xml.XDocument": "(,4.3.32767]", + "System.Xml.XmlDocument": "(,4.3.32767]", + "System.Xml.XmlSerializer": "(,4.3.32767]", + "System.Xml.XPath": "(,4.3.32767]", + "System.Xml.XPath.XDocument": "(,5.0.32767]" + } + } + } + } + } +} \ No newline at end of file diff --git a/Tag 2/obj/Tag 2.csproj.nuget.g.props b/Tag 2/Aufgaben/obj/Aufgaben.csproj.nuget.g.props similarity index 100% rename from Tag 2/obj/Tag 2.csproj.nuget.g.props rename to Tag 2/Aufgaben/obj/Aufgaben.csproj.nuget.g.props diff --git a/Tag 2/obj/Tag 2.csproj.nuget.g.targets b/Tag 2/Aufgaben/obj/Aufgaben.csproj.nuget.g.targets similarity index 100% rename from Tag 2/obj/Tag 2.csproj.nuget.g.targets rename to Tag 2/Aufgaben/obj/Aufgaben.csproj.nuget.g.targets diff --git a/Tag 2/Aufgaben/obj/project.assets.json b/Tag 2/Aufgaben/obj/project.assets.json new file mode 100644 index 0000000..58ea7bc --- /dev/null +++ b/Tag 2/Aufgaben/obj/project.assets.json @@ -0,0 +1,347 @@ +{ + "version": 3, + "targets": { + "net10.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net10.0": [] + }, + "packageFolders": { + "/home/wbs/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/wbs/Dokumente/Programmierung/wbs-csharp/Tag 2/Aufgaben/Aufgaben.csproj", + "projectName": "Aufgaben", + "projectPath": "/home/wbs/Dokumente/Programmierung/wbs-csharp/Tag 2/Aufgaben/Aufgaben.csproj", + "packagesPath": "/home/wbs/.nuget/packages/", + "outputPath": "/home/wbs/Dokumente/Programmierung/wbs-csharp/Tag 2/Aufgaben/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/wbs/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net10.0" + ], + "sources": { + "/usr/lib64/dotnet/library-packs": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net10.0": { + "targetAlias": "net10.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "all" + }, + "SdkAnalysisLevel": "10.0.100" + }, + "frameworks": { + "net10.0": { + "targetAlias": "net10.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/lib64/dotnet/sdk/10.0.110/PortableRuntimeIdentifierGraph.json", + "packagesToPrune": { + "Microsoft.CSharp": "(,4.7.32767]", + "Microsoft.VisualBasic": "(,10.4.32767]", + "Microsoft.Win32.Primitives": "(,4.3.32767]", + "Microsoft.Win32.Registry": "(,5.0.32767]", + "runtime.any.System.Collections": "(,4.3.32767]", + "runtime.any.System.Diagnostics.Tools": "(,4.3.32767]", + "runtime.any.System.Diagnostics.Tracing": "(,4.3.32767]", + "runtime.any.System.Globalization": "(,4.3.32767]", + "runtime.any.System.Globalization.Calendars": "(,4.3.32767]", + "runtime.any.System.IO": "(,4.3.32767]", + "runtime.any.System.Reflection": "(,4.3.32767]", + "runtime.any.System.Reflection.Extensions": "(,4.3.32767]", + "runtime.any.System.Reflection.Primitives": "(,4.3.32767]", + "runtime.any.System.Resources.ResourceManager": "(,4.3.32767]", + "runtime.any.System.Runtime": "(,4.3.32767]", + "runtime.any.System.Runtime.Handles": "(,4.3.32767]", + "runtime.any.System.Runtime.InteropServices": "(,4.3.32767]", + "runtime.any.System.Text.Encoding": "(,4.3.32767]", + "runtime.any.System.Text.Encoding.Extensions": "(,4.3.32767]", + "runtime.any.System.Threading.Tasks": "(,4.3.32767]", + "runtime.any.System.Threading.Timer": "(,4.3.32767]", + "runtime.aot.System.Collections": "(,4.3.32767]", + "runtime.aot.System.Diagnostics.Tools": "(,4.3.32767]", + "runtime.aot.System.Diagnostics.Tracing": "(,4.3.32767]", + "runtime.aot.System.Globalization": "(,4.3.32767]", + "runtime.aot.System.Globalization.Calendars": "(,4.3.32767]", + "runtime.aot.System.IO": "(,4.3.32767]", + "runtime.aot.System.Reflection": "(,4.3.32767]", + "runtime.aot.System.Reflection.Extensions": "(,4.3.32767]", + "runtime.aot.System.Reflection.Primitives": "(,4.3.32767]", + "runtime.aot.System.Resources.ResourceManager": "(,4.3.32767]", + "runtime.aot.System.Runtime": "(,4.3.32767]", + "runtime.aot.System.Runtime.Handles": "(,4.3.32767]", + "runtime.aot.System.Runtime.InteropServices": "(,4.3.32767]", + "runtime.aot.System.Text.Encoding": "(,4.3.32767]", + "runtime.aot.System.Text.Encoding.Extensions": "(,4.3.32767]", + "runtime.aot.System.Threading.Tasks": "(,4.3.32767]", + "runtime.aot.System.Threading.Timer": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.debian.9-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.27-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.fedora.28-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.opensuse.42.3-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "(,4.3.32767]", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography": "(,4.3.32767]", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System.Net.Http": "(,4.3.32767]", + "runtime.ubuntu.18.04-x64.runtime.native.System.Net.Security": "(,4.3.32767]", + "runtime.unix.Microsoft.Win32.Primitives": "(,4.3.32767]", + "runtime.unix.System.Console": "(,4.3.32767]", + "runtime.unix.System.Diagnostics.Debug": "(,4.3.32767]", + "runtime.unix.System.IO.FileSystem": "(,4.3.32767]", + "runtime.unix.System.Net.Primitives": "(,4.3.32767]", + "runtime.unix.System.Net.Sockets": "(,4.3.32767]", + "runtime.unix.System.Private.Uri": "(,4.3.32767]", + "runtime.unix.System.Runtime.Extensions": "(,4.3.32767]", + "runtime.win.Microsoft.Win32.Primitives": "(,4.3.32767]", + "runtime.win.System.Console": "(,4.3.32767]", + "runtime.win.System.Diagnostics.Debug": "(,4.3.32767]", + "runtime.win.System.IO.FileSystem": "(,4.3.32767]", + "runtime.win.System.Net.Primitives": "(,4.3.32767]", + "runtime.win.System.Net.Sockets": "(,4.3.32767]", + "runtime.win.System.Runtime.Extensions": "(,4.3.32767]", + "runtime.win10-arm-aot.runtime.native.System.IO.Compression": "(,4.0.32767]", + "runtime.win10-arm64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.win10-x64-aot.runtime.native.System.IO.Compression": "(,4.0.32767]", + "runtime.win10-x86-aot.runtime.native.System.IO.Compression": "(,4.0.32767]", + "runtime.win7-x64.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.win7-x86.runtime.native.System.IO.Compression": "(,4.3.32767]", + "runtime.win7.System.Private.Uri": "(,4.3.32767]", + "runtime.win8-arm.runtime.native.System.IO.Compression": "(,4.3.32767]", + "System.AppContext": "(,4.3.32767]", + "System.Buffers": "(,5.0.32767]", + "System.Collections": "(,4.3.32767]", + "System.Collections.Concurrent": "(,4.3.32767]", + "System.Collections.Immutable": "(,10.0.32767]", + "System.Collections.NonGeneric": "(,4.3.32767]", + "System.Collections.Specialized": "(,4.3.32767]", + "System.ComponentModel": "(,4.3.32767]", + "System.ComponentModel.Annotations": "(,4.3.32767]", + "System.ComponentModel.EventBasedAsync": "(,4.3.32767]", + "System.ComponentModel.Primitives": "(,4.3.32767]", + "System.ComponentModel.TypeConverter": "(,4.3.32767]", + "System.Console": "(,4.3.32767]", + "System.Data.Common": "(,4.3.32767]", + "System.Data.DataSetExtensions": "(,4.4.32767]", + "System.Diagnostics.Contracts": "(,4.3.32767]", + "System.Diagnostics.Debug": "(,4.3.32767]", + "System.Diagnostics.DiagnosticSource": "(,10.0.32767]", + "System.Diagnostics.FileVersionInfo": "(,4.3.32767]", + "System.Diagnostics.Process": "(,4.3.32767]", + "System.Diagnostics.StackTrace": "(,4.3.32767]", + "System.Diagnostics.TextWriterTraceListener": "(,4.3.32767]", + "System.Diagnostics.Tools": "(,4.3.32767]", + "System.Diagnostics.TraceSource": "(,4.3.32767]", + "System.Diagnostics.Tracing": "(,4.3.32767]", + "System.Drawing.Primitives": "(,4.3.32767]", + "System.Dynamic.Runtime": "(,4.3.32767]", + "System.Formats.Asn1": "(,10.0.32767]", + "System.Formats.Tar": "(,10.0.32767]", + "System.Globalization": "(,4.3.32767]", + "System.Globalization.Calendars": "(,4.3.32767]", + "System.Globalization.Extensions": "(,4.3.32767]", + "System.IO": "(,4.3.32767]", + "System.IO.Compression": "(,4.3.32767]", + "System.IO.Compression.ZipFile": "(,4.3.32767]", + "System.IO.FileSystem": "(,4.3.32767]", + "System.IO.FileSystem.AccessControl": "(,4.4.32767]", + "System.IO.FileSystem.DriveInfo": "(,4.3.32767]", + "System.IO.FileSystem.Primitives": "(,4.3.32767]", + "System.IO.FileSystem.Watcher": "(,4.3.32767]", + "System.IO.IsolatedStorage": "(,4.3.32767]", + "System.IO.MemoryMappedFiles": "(,4.3.32767]", + "System.IO.Pipelines": "(,10.0.32767]", + "System.IO.Pipes": "(,4.3.32767]", + "System.IO.Pipes.AccessControl": "(,5.0.32767]", + "System.IO.UnmanagedMemoryStream": "(,4.3.32767]", + "System.Linq": "(,4.3.32767]", + "System.Linq.AsyncEnumerable": "(,10.0.32767]", + "System.Linq.Expressions": "(,4.3.32767]", + "System.Linq.Parallel": "(,4.3.32767]", + "System.Linq.Queryable": "(,4.3.32767]", + "System.Memory": "(,5.0.32767]", + "System.Net.Http": "(,4.3.32767]", + "System.Net.Http.Json": "(,10.0.32767]", + "System.Net.NameResolution": "(,4.3.32767]", + "System.Net.NetworkInformation": "(,4.3.32767]", + "System.Net.Ping": "(,4.3.32767]", + "System.Net.Primitives": "(,4.3.32767]", + "System.Net.Requests": "(,4.3.32767]", + "System.Net.Security": "(,4.3.32767]", + "System.Net.ServerSentEvents": "(,10.0.32767]", + "System.Net.Sockets": "(,4.3.32767]", + "System.Net.WebHeaderCollection": "(,4.3.32767]", + "System.Net.WebSockets": "(,4.3.32767]", + "System.Net.WebSockets.Client": "(,4.3.32767]", + "System.Numerics.Vectors": "(,5.0.32767]", + "System.ObjectModel": "(,4.3.32767]", + "System.Private.DataContractSerialization": "(,4.3.32767]", + "System.Private.Uri": "(,4.3.32767]", + "System.Reflection": "(,4.3.32767]", + "System.Reflection.DispatchProxy": "(,6.0.32767]", + "System.Reflection.Emit": "(,4.7.32767]", + "System.Reflection.Emit.ILGeneration": "(,4.7.32767]", + "System.Reflection.Emit.Lightweight": "(,4.7.32767]", + "System.Reflection.Extensions": "(,4.3.32767]", + "System.Reflection.Metadata": "(,10.0.32767]", + "System.Reflection.Primitives": "(,4.3.32767]", + "System.Reflection.TypeExtensions": "(,4.3.32767]", + "System.Resources.Reader": "(,4.3.32767]", + "System.Resources.ResourceManager": "(,4.3.32767]", + "System.Resources.Writer": "(,4.3.32767]", + "System.Runtime": "(,4.3.32767]", + "System.Runtime.CompilerServices.Unsafe": "(,7.0.32767]", + "System.Runtime.CompilerServices.VisualC": "(,4.3.32767]", + "System.Runtime.Extensions": "(,4.3.32767]", + "System.Runtime.Handles": "(,4.3.32767]", + "System.Runtime.InteropServices": "(,4.3.32767]", + "System.Runtime.InteropServices.RuntimeInformation": "(,4.3.32767]", + "System.Runtime.Loader": "(,4.3.32767]", + "System.Runtime.Numerics": "(,4.3.32767]", + "System.Runtime.Serialization.Formatters": "(,4.3.32767]", + "System.Runtime.Serialization.Json": "(,4.3.32767]", + "System.Runtime.Serialization.Primitives": "(,4.3.32767]", + "System.Runtime.Serialization.Xml": "(,4.3.32767]", + "System.Security.AccessControl": "(,6.0.32767]", + "System.Security.Claims": "(,4.3.32767]", + "System.Security.Cryptography.Algorithms": "(,4.3.32767]", + "System.Security.Cryptography.Cng": "(,5.0.32767]", + "System.Security.Cryptography.Csp": "(,4.3.32767]", + "System.Security.Cryptography.Encoding": "(,4.3.32767]", + "System.Security.Cryptography.OpenSsl": "(,5.0.32767]", + "System.Security.Cryptography.Primitives": "(,4.3.32767]", + "System.Security.Cryptography.X509Certificates": "(,4.3.32767]", + "System.Security.Principal": "(,4.3.32767]", + "System.Security.Principal.Windows": "(,5.0.32767]", + "System.Security.SecureString": "(,4.3.32767]", + "System.Text.Encoding": "(,4.3.32767]", + "System.Text.Encoding.CodePages": "(,10.0.32767]", + "System.Text.Encoding.Extensions": "(,4.3.32767]", + "System.Text.Encodings.Web": "(,10.0.32767]", + "System.Text.Json": "(,10.0.32767]", + "System.Text.RegularExpressions": "(,4.3.32767]", + "System.Threading": "(,4.3.32767]", + "System.Threading.AccessControl": "(,10.0.32767]", + "System.Threading.Channels": "(,10.0.32767]", + "System.Threading.Overlapped": "(,4.3.32767]", + "System.Threading.Tasks": "(,4.3.32767]", + "System.Threading.Tasks.Dataflow": "(,10.0.32767]", + "System.Threading.Tasks.Extensions": "(,5.0.32767]", + "System.Threading.Tasks.Parallel": "(,4.3.32767]", + "System.Threading.Thread": "(,4.3.32767]", + "System.Threading.ThreadPool": "(,4.3.32767]", + "System.Threading.Timer": "(,4.3.32767]", + "System.ValueTuple": "(,4.5.32767]", + "System.Xml.ReaderWriter": "(,4.3.32767]", + "System.Xml.XDocument": "(,4.3.32767]", + "System.Xml.XmlDocument": "(,4.3.32767]", + "System.Xml.XmlSerializer": "(,4.3.32767]", + "System.Xml.XPath": "(,4.3.32767]", + "System.Xml.XPath.XDocument": "(,5.0.32767]" + } + } + } + } +} \ No newline at end of file diff --git a/Tag 2/Aufgaben/obj/project.nuget.cache b/Tag 2/Aufgaben/obj/project.nuget.cache new file mode 100644 index 0000000..c140344 --- /dev/null +++ b/Tag 2/Aufgaben/obj/project.nuget.cache @@ -0,0 +1,8 @@ +{ + "version": 2, + "dgSpecHash": "GWzEprZOvw8=", + "success": true, + "projectFilePath": "/home/wbs/Dokumente/Programmierung/wbs-csharp/Tag 2/Aufgaben/Aufgaben.csproj", + "expectedPackageFiles": [], + "logs": [] +} \ No newline at end of file diff --git a/Tag 2/Program.cs b/Tag 2/Unterricht/Program.cs similarity index 61% rename from Tag 2/Program.cs rename to Tag 2/Unterricht/Program.cs index d068b83..adb9b26 100644 --- a/Tag 2/Program.cs +++ b/Tag 2/Unterricht/Program.cs @@ -1,2 +1,3 @@ using Tag_02_Unterricht; +Vererbung.Main(); diff --git a/Tag 2/Statische_Felder.cs b/Tag 2/Unterricht/Statische_Felder.cs similarity index 100% rename from Tag 2/Statische_Felder.cs rename to Tag 2/Unterricht/Statische_Felder.cs diff --git a/Tag 2/Tag 2.csproj b/Tag 2/Unterricht/Tag 2.csproj similarity index 100% rename from Tag 2/Tag 2.csproj rename to Tag 2/Unterricht/Tag 2.csproj diff --git a/Tag 2/Unterricht/Vererbung.cs b/Tag 2/Unterricht/Vererbung.cs new file mode 100644 index 0000000..c4ec0cf --- /dev/null +++ b/Tag 2/Unterricht/Vererbung.cs @@ -0,0 +1,70 @@ +namespace Tag_02_Unterricht; + +public class Vererbung +{ + public static void Main() + { + var kaffee = new Kaffee(); + kaffee.WieHeißBinIch(); + + var tee = new Tee(); + + var getränke = new List(); + getränke.Add(kaffee); + getränke.Add(tee); + + foreach (var getränk in getränke){ + getränk.Ausgießen(); + } + + Getränk kaffeeAlsGetränk = new Kaffee(); + + if (kaffeeAlsGetränk is Kaffee) Console.WriteLine("Das Getränk ist ein Kaffee."); + if (kaffeeAlsGetränk is Tee) Console.WriteLine("Das Getränk ist ein Tee."); + + if (kaffeeAlsGetränk is Kaffee) + { + var wiederAlsKaffee = (Kaffee) kaffeeAlsGetränk; + } + + } +} + +class Getränk +{ + protected int temperatur = 100; +} + +interface IFlüssigkeit +{ + void Ausgießen(); +} + +interface INahrungsmittel +{ + +} + +class Kaffee : Getränk, IFlüssigkeit +{ + protected int koffeingehalt; + + public void WieHeißBinIch() + { + Console.WriteLine(temperatur); + } + + public void Ausgießen() + { + Console.WriteLine("Blubb blubb blubb!"); + } +} + + +class Tee : Getränk, IFlüssigkeit +{ + public void Ausgießen() + { + Console.WriteLine("Blubb blubb!"); + } +} diff --git a/Tag 2/bin/Debug/net10.0/Tag 2 b/Tag 2/Unterricht/bin/Debug/net10.0/Tag 2 similarity index 100% rename from Tag 2/bin/Debug/net10.0/Tag 2 rename to Tag 2/Unterricht/bin/Debug/net10.0/Tag 2 diff --git a/Tag 2/bin/Debug/net10.0/Tag 2.deps.json b/Tag 2/Unterricht/bin/Debug/net10.0/Tag 2.deps.json similarity index 100% rename from Tag 2/bin/Debug/net10.0/Tag 2.deps.json rename to Tag 2/Unterricht/bin/Debug/net10.0/Tag 2.deps.json diff --git a/Tag 2/Unterricht/bin/Debug/net10.0/Tag 2.dll b/Tag 2/Unterricht/bin/Debug/net10.0/Tag 2.dll new file mode 100644 index 0000000000000000000000000000000000000000..a95b71a159504504c2028b67c6427088215f78a2 GIT binary patch literal 6144 zcmeHLdyHIF8UOB`+1c4?yWK|%TN~}|wBSm&GyCecTX(nnY&)>sE<4i}CD`7XIWv3N zJNFLv-dVaLPz)vg1C!Pel=uLVNMcAtLlgz%k1Ek1|7e8%p@ISZi=+?}V>E)l@7y~t zEQ{w^CGcfLu_ZDdU1|uUJ213I=*_L zYV9?O(>kRe%0Y?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^H)vnnNlwY42e*uM_3*mu~)@{U)JHV%aFibM~$~*7CAhPuLO!m%g9U?6+!Wk zT|8hpJcC!3p>vltY4}i~EdDfnR~m08+Hz$naOlrl?z`rRAKWqfRkcft_*9g9*RlO-q+N|fTR{70J2IydRe~QCALEBSqh58w(aQ_AHFr8E z%6#E7%Z`1!%W|y>r_}=rZAmQ5WoB$gOqI)h!4(-_9q3Q=Lqq$fT9)CYX6kDTNIGpi zMPreeLM?tCM#(}gGONj|s&xRx82*Tc6iP^Bmp+gk9Vv|L8yU@y>>U#OhDY~|7WDr9 z;nCr}L&Jlk`-VpMWQX_UQ9`hDEwVTPM1#X9X6xVeW>;O_%~J1 zcoIrtyl|-Hz!tUlp0V9hqN?SJ2ceW%{Z5H;k-_ zJ5GJ5DHT+M{1TLiVy+Fl6~yf|c-1(E=<}3>Kh3i5 zjl3TBF4!HwZj90hc6|gVc?9D;;9gYl0{AfSJ@^Wczs7!8lKYWmn`X_=T|MqaZlqwhDX{`9;TAMZsPa?g!L46zG(C zYif}Ca}|E%=f$cpHIw0ZTz6B}s=XqdxK=TyawrqAf(6}lg&&aAk*q1H`x3aFZ1j69 iSqpz6HkPbz%!E8EA3C7<|1Z=r{-N{i{|@~ZR^T7I-Sjd5 literal 0 HcmV?d00001 diff --git a/Tag 2/bin/Debug/net10.0/Tag 2.pdb b/Tag 2/Unterricht/bin/Debug/net10.0/Tag 2.pdb similarity index 86% rename from Tag 2/bin/Debug/net10.0/Tag 2.pdb rename to Tag 2/Unterricht/bin/Debug/net10.0/Tag 2.pdb index ec155095bee64e0ab8b80524d28b515ec3af04a0..86243a8e669f5e776426b787a01b56018472febc 100644 GIT binary patch delta 1121 zcmZuwYes|)crA4bIulDGNK2EfES#p5p{8@0VmhbgkGxe-{itLH zQieie8>ahV7pd%zc0tRc8-s+RP{N87Ea+e7e16)3zH!cbp65L8c`xT(Pm$~3rM0d3 z01&;m;xG>I5^aJZZUN}x0GX6CS}j$z<_5~UkQ0b2Fv1MRr4(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HV%aFibM~$~*7CAhPuLO!m%g9U?6+!Wk zT|8hpJcC!3p>vltY4}i~EdDfnR~m08+Hz$naOlrl?z`rRAKWqfRkcft_*9g9*RlO-q+N|fTR{70J2IydRe~QCALEBSqh58w(aQ_AHFr8E z%6#E7%Z`1!%W|y>r_}=rZAmQ5WoB$gOqI)h!4(-_9q3Q=Lqq$fT9)CYX6kDTNIGpi zMPreeLM?tCM#(}gGONj|s&xRx82*Tc6iP^Bmp+gk9Vv|L8yU@y>>U#OhDY~|7WDr9 z;nCr}L&Jlk`-VpMWQX_UQ9`hDEwVTPM1#X9X6xVeW>;O_%~J1 zcoIrtyl|-Hz!tUlp0V9hqN?SJ2ceW%{Z5H;k-_ zJ5GJ5DHT+M{1TLiVy+Fl6~yf|c-1(E=<}3>Kh3i5 zjl3TBF4!HwZj90hc6|gVc?9D;;9gYl0{AfSJ@^Wczs7!8lKYWmn`X_=T|MqaZlqwhDX{`9;TAMZsPa?g!L46zG(C zYif}Ca}|E%=f$cpHIw0ZTz6B}s=XqdxK=TyawrqAf(6}lg&&aAk*q1H`x3aFZ1j69 iSqpz6HkPbz%!E8EA3C7<|1Z=r{-N{i{|@~ZR^T7I-Sjd5 literal 0 HcmV?d00001 diff --git a/Tag 2/obj/Debug/net10.0/Tag 2.genruntimeconfig.cache b/Tag 2/Unterricht/obj/Debug/net10.0/Tag 2.genruntimeconfig.cache similarity index 100% rename from Tag 2/obj/Debug/net10.0/Tag 2.genruntimeconfig.cache rename to Tag 2/Unterricht/obj/Debug/net10.0/Tag 2.genruntimeconfig.cache diff --git a/Tag 2/obj/Debug/net10.0/Tag 2.pdb b/Tag 2/Unterricht/obj/Debug/net10.0/Tag 2.pdb similarity index 86% rename from Tag 2/obj/Debug/net10.0/Tag 2.pdb rename to Tag 2/Unterricht/obj/Debug/net10.0/Tag 2.pdb index ec155095bee64e0ab8b80524d28b515ec3af04a0..86243a8e669f5e776426b787a01b56018472febc 100644 GIT binary patch delta 1121 zcmZuwYes|)crA4b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p+3NwFBgL{qe;D(f)h0M7y+L$837&yVq}T+QNKa^T2F zjuNP2*vV}|#(fsCb|Iq<`6eQwB7Zwiplt`A1JSp2qTff7^u3?GF*&neH`P7A0GdkT z_D`y)Bv^RaFa9BiNvH96kI9we~)(8BOvwXm*9(bfD2kL2$$qP1q>P8;-Gu+OR6z z_bD?I$dqyq#o)!#oBXJ+ialYfCc~+u=B`+K_O5V}YSWn2QI{Zs70q;o?~s%+d?=)C nOJMeJ)b7dQL-(f>lf&V`Ov_yPuLF7i8~uy8)bF + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/wbs/.nuget/packages/ + /home/wbs/.nuget/packages/ + PackageReference + 7.0.0 + + + + + \ No newline at end of file diff --git a/Tag 2/Unterricht/obj/Tag 2.csproj.nuget.g.targets b/Tag 2/Unterricht/obj/Tag 2.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/Tag 2/Unterricht/obj/Tag 2.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Tag 2/obj/project.assets.json b/Tag 2/Unterricht/obj/project.assets.json similarity index 100% rename from Tag 2/obj/project.assets.json rename to Tag 2/Unterricht/obj/project.assets.json diff --git a/Tag 2/obj/project.nuget.cache b/Tag 2/Unterricht/obj/project.nuget.cache similarity index 100% rename from Tag 2/obj/project.nuget.cache rename to Tag 2/Unterricht/obj/project.nuget.cache diff --git a/Tag 2/Vererbung.cs b/Tag 2/Vererbung.cs deleted file mode 100644 index f22e0bc..0000000 --- a/Tag 2/Vererbung.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace Tag_02_Unterricht; - -public class Vererbung -{ - public static void Main() - { - - } -} - -class Getränk -{ - protected int temperatur = 100; -} - -interface IFlüssigkeit -{ - void Ausgießen(); -} - -class Kaffee : Getränk, IFlüssigkeit -{ - public void WieHeißBinIch() - { - Console.WriteLine(temperatur); - } - - public void Ausgießen() - { - Console.WriteLine("Blubb blubb blubb!"); - } -} - - -class Tee : Getränk -{ - -} diff --git a/Tag 2/bin/Debug/net10.0/Tag 2.dll b/Tag 2/bin/Debug/net10.0/Tag 2.dll deleted file mode 100644 index abffacea80fdb1d4ced317e13450fe8bd047168b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5120 zcmeHKYiJzT6+Sb1L|#XVT)U|gLp@&Ejbcapl4RMgWb3h#y^SoZ+OlmOYc#YEDTc`uk)1L(|LiM2kunnK|>- zXtqC6oVF_|q8K=R0r$0s@zv0$(HUs?sDaAM}lF0FcR8L%%`ErV(98 zxSnf(lD%qOor(_0XFd(bap1 z6wsK8XM11mFu537A0FU{4uU$+rangMFx={;gG;JA1^!b|?N*2Hle!5v2i7JOx({M# zJmSx)drMDYi?$Sxk@^{?hq1E39Ov6}U>J4`rf4AuI{%4TMMf0lXMHS@N{psP(?>b9 z9V0$tD!ud_ zx~cTiSCkB-+a!F282^)m7bNGh#E0eBri9NDTYFL6qsC}~_Q=WD8}@^LgOpXTsZ%ZL zw!%~w=3~$Mq^t|a@tdH24hkzEBOIh7bWI%u#m9A!#zLweBUfky!7l-Jldh&{S%V5) z#`zw_JfD`-GxQ5YqmU)3FTw&->jAa90G}25lBB-8`*D@WU6#~k8j;l3w`hKA3q`WM z(i4|fUJ7LNH#y(WB=wdO$ZiC(aK7Jep?YZ-A}wHDb^!L$1AsAl7;uo%5+0RsM#7wg zpOo-133Wh)Ou!G*lM+5dWqOdBzjiQ|-Y@=i_oRh)_CM$s~jPEOv}eQ*jw(4%^}j8DGl`J$GXb8OGC1lhV#we?zy zztXUM6Xbc<^u?lS3(AUOqf*g}mYDHz@`?>#&{D&)wsK}XPt=N5vtat2iUr-R2!8>O zj=1Q!Yi$dW{(@ZT=?SA?Z+NUTF1dA95#!G_-+7zK^__=#u>q7iIax0`K2m`us{&7x_UeuuPU z;i6Ru2PDE+v7`i4xWxvr^QJf@%~)>7?-8>)*E5g8h&vSypI;W*T0_6xXi^ zn@;Pd-7+r9mM}P(B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