From fa974e021fe5346210152e02352f9661ce5dbb56 Mon Sep 17 00:00:00 2001 From: sebi Date: Mon, 13 Nov 2023 17:00:25 +0100 Subject: [PATCH] Dictionary (Nur Angefangen!!) --- XX_Dictionary/Exercise_1.cs | 20 ++++++++++++++++++++ XX_Dictionary/Exercise_2.cs | 20 ++++++++++++++++++++ XX_Dictionary/Exercise_3.cs | 25 +++++++++++++++++++++++++ XX_Dictionary/Exercise_4.cs | 21 +++++++++++++++++++++ XX_Dictionary/Exercise_5.cs | 21 +++++++++++++++++++++ 5 files changed, 107 insertions(+) create mode 100644 XX_Dictionary/Exercise_1.cs create mode 100644 XX_Dictionary/Exercise_2.cs create mode 100644 XX_Dictionary/Exercise_3.cs create mode 100644 XX_Dictionary/Exercise_4.cs create mode 100644 XX_Dictionary/Exercise_5.cs diff --git a/XX_Dictionary/Exercise_1.cs b/XX_Dictionary/Exercise_1.cs new file mode 100644 index 0000000..fd1b70b --- /dev/null +++ b/XX_Dictionary/Exercise_1.cs @@ -0,0 +1,20 @@ +using System; +using System.IO; +using Microsoft.VisualBasic; + +namespace Exercises_C_Sharp.XX_Dictionary +{ + class Exercise_1 + { + //Erstellen Sie ein Dictionary, das zu den Datentypen passt. + public static void Start() + { + //Code Start + dynamic dic = -1; + //Code ENDE + dic.Add("Hallo", 12.54); + dic.Add("Hi", 7.33); + dic.Add("Hey", 0.56); + } + } +} \ No newline at end of file diff --git a/XX_Dictionary/Exercise_2.cs b/XX_Dictionary/Exercise_2.cs new file mode 100644 index 0000000..b1b8516 --- /dev/null +++ b/XX_Dictionary/Exercise_2.cs @@ -0,0 +1,20 @@ +using System; +using System.IO; +using Microsoft.VisualBasic; + +namespace Exercises_C_Sharp.XX_Dictionary +{ + class Exercise_2 + { + //Geben Sie alle Value-Werte hintereinander mit Leerzeichen getrennt auf der Konsole aus. + public static void Start() + { + Dictionary dic = new() { {12, "Dies"}, {4, "ist"}, {22, "ein"}, {94, "tolles"}, {26, "Ding!"} }; + + //Code Start + + //Code ENDE + + } + } +} \ No newline at end of file diff --git a/XX_Dictionary/Exercise_3.cs b/XX_Dictionary/Exercise_3.cs new file mode 100644 index 0000000..4327ffd --- /dev/null +++ b/XX_Dictionary/Exercise_3.cs @@ -0,0 +1,25 @@ +using System; +using System.IO; +using Microsoft.VisualBasic; + +namespace Exercises_C_Sharp.XX_Dictionary +{ + class Exercise_3 + { + //Sorgen Sie dafür, dass auf der Konsole "Dies ist mein Programm" ausgegeben wird. + public static void Start() + { + Dictionary dic = new(); + + //Code Start + + //Code ENDE + + Console.Write(dic["dieses"]); + Console.Write(dic["ist"]); + Console.Write(dic["Programm"]); + Console.Write(dic["es"]); + + } + } +} \ No newline at end of file diff --git a/XX_Dictionary/Exercise_4.cs b/XX_Dictionary/Exercise_4.cs new file mode 100644 index 0000000..b0d6250 --- /dev/null +++ b/XX_Dictionary/Exercise_4.cs @@ -0,0 +1,21 @@ +using System; +using System.IO; +using Microsoft.VisualBasic; + +namespace Exercises_C_Sharp.XX_Dictionary +{ + class Exercise_4 + { + //... + public static void Start() + { + Dictionary dic = new(); + + //Code Start + + //Code ENDE + + + } + } +} \ No newline at end of file diff --git a/XX_Dictionary/Exercise_5.cs b/XX_Dictionary/Exercise_5.cs new file mode 100644 index 0000000..80484fd --- /dev/null +++ b/XX_Dictionary/Exercise_5.cs @@ -0,0 +1,21 @@ +using System; +using System.IO; +using Microsoft.VisualBasic; + +namespace Exercises_C_Sharp.XX_Dictionary +{ + class Exercise_5 + { + //... + public static void Start() + { + Dictionary dic = new(); + + //Code Start + + //Code ENDE + + + } + } +} \ No newline at end of file