Dictionary Übungen erweitert & zur Program hinzugefügt

Sorting angepasst
Multithreading angefangen
main
Sebastian Schüler 2023-11-27 16:36:18 +01:00
parent 423babfbbc
commit 32ca0295c9
9 changed files with 22 additions and 4 deletions

View File

@ -448,6 +448,23 @@ namespace Exercises_C_Sharp
} }
}; };
//************************
//******Dictionary********
//************************
ExerciseGroup dictionaryElements = new ExerciseGroup()
{
Name = "Schulaufgaben",
ElementList = new List<ExerciseElement>()
{
new ExerciseElement(){Name = "Aufgabe 1", Method = Exercises_C_Sharp.XX_Dictionary.Exercise_1.Start},
new ExerciseElement(){Name = "Aufgabe 2", Method = Exercises_C_Sharp.XX_Dictionary.Exercise_2.Start},
new ExerciseElement(){Name = "Aufgabe 3", Method = Exercises_C_Sharp.XX_Dictionary.Exercise_3.Start},
new ExerciseElement(){Name = "Aufgabe 4", Method = Exercises_C_Sharp.XX_Dictionary.Exercise_4.Start},
new ExerciseElement(){Name = "Aufgabe 5", Method = Exercises_C_Sharp.XX_Dictionary.Exercise_5.Start}
}
};
//************************ //************************
//****Sortieren******* //****Sortieren*******
//************************ //************************
@ -494,6 +511,7 @@ namespace Exercises_C_Sharp
filesystemElements, filesystemElements,
mysqlElements, mysqlElements,
sortElements, sortElements,
dictionaryElements,
examElements examElements
}; };

View File

@ -6,10 +6,10 @@ namespace Exercises_C_Sharp.XX_Dictionary
{ {
class Exercise_4 class Exercise_4
{ {
//... //Addieren Sie alle Value-Werte mit geraden Index auf und geben Sie das Ergebnis aus.
public static void Start() public static void Start()
{ {
Dictionary<string, string> dic = new(); 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 Start

View File

@ -6,10 +6,10 @@ namespace Exercises_C_Sharp.XX_Dictionary
{ {
class Exercise_5 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() public static void Start()
{ {
Dictionary<string, string> dic = new(); Dictionary<string, string> dic = new(){{"black", "schwarz"}, {"exception", "Ausnahme"}, {"barrel", "Fass"}};
//Code Start //Code Start

View File

View File

View File

View File

View File