This commit is contained in:
2024-07-17 07:20:18 +02:00
parent 3e9256b983
commit bedea4caf3
264 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using System;
using System.IO;
using Microsoft.VisualBasic;
namespace Exercises_C_Sharp.E22_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);
}
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.IO;
using Microsoft.VisualBasic;
namespace Exercises_C_Sharp.E22_Dictionary
{
class Exercise_2
{
//Geben Sie alle Value-Werte hintereinander mit Leerzeichen getrennt auf der Konsole aus.
public static void Start()
{
Dictionary<int, string> dic = new() { {12, "Dies"}, {4, "ist"}, {22, "ein"}, {94, "tolles"}, {26, "Ding!"} };
//Code Start
//Code ENDE
}
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.IO;
using Microsoft.VisualBasic;
namespace Exercises_C_Sharp.E22_Dictionary
{
class Exercise_3
{
//Sorgen Sie dafür, dass auf der Konsole "Dies ist mein Programm" ausgegeben wird.
public static void Start()
{
Dictionary<string, string> dic = new();
//Code Start
//Code ENDE
Console.Write(dic["dieses"]);
Console.Write(dic["ist"]);
Console.Write(dic["Programm"]);
Console.Write(dic["es"]);
}
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.IO;
using Microsoft.VisualBasic;
namespace Exercises_C_Sharp.E22_Dictionary
{
class Exercise_4
{
//Addieren Sie alle Value-Werte mit geraden Index auf und geben Sie das Ergebnis aus.
public static void Start()
{
Dictionary<int, double> dic = new() {{1, 14.85}, {2, 58.52}, {3, 8.63}, {4, 6.49}, {5, 62.85}, {6, 2.22}, {7, 3.33}, {8, 9.99}};
//Code Start
//Code ENDE
}
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.IO;
using Microsoft.VisualBasic;
namespace Exercises_C_Sharp.E22_Dictionary
{
class Exercise_5
{
//Der User soll hier ein Wort eingeben. Wenn es sich schon im Dictionary befindet, dann soll die Übersetzung ausgegeben werden. Wenn nicht, dass soll der User die Übersetzung eingeben und beide Elemente sollen in dem Dictionary gespeichert werden. Groß- und Kleinschreibung soll keine Rolle spielen.
public static void Start()
{
Dictionary<string, string> dic = new(){{"black", "schwarz"}, {"exception", "Ausnahme"}, {"barrel", "Fass"}};
//Code Start
//Code ENDE
}
}
}