Dictionary Übungen erweitert & zur Program hinzugefügt
Sorting angepasst Multithreading angefangenmain
parent
423babfbbc
commit
32ca0295c9
18
Program.cs
18
Program.cs
|
|
@ -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*******
|
||||
//************************
|
||||
|
|
@ -494,6 +511,7 @@ namespace Exercises_C_Sharp
|
|||
filesystemElements,
|
||||
mysqlElements,
|
||||
sortElements,
|
||||
dictionaryElements,
|
||||
|
||||
examElements
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ namespace Exercises_C_Sharp.XX_Dictionary
|
|||
{
|
||||
class Exercise_4
|
||||
{
|
||||
//...
|
||||
//Addieren Sie alle Value-Werte mit geraden Index auf und geben Sie das Ergebnis aus.
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ namespace Exercises_C_Sharp.XX_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();
|
||||
Dictionary<string, string> dic = new(){{"black", "schwarz"}, {"exception", "Ausnahme"}, {"barrel", "Fass"}};
|
||||
|
||||
//Code Start
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue