Dictionary (Nur Angefangen!!)
parent
af48c0dfec
commit
fa974e021f
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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<int, string> dic = new() { {12, "Dies"}, {4, "ist"}, {22, "ein"}, {94, "tolles"}, {26, "Ding!"} };
|
||||||
|
|
||||||
|
//Code Start
|
||||||
|
|
||||||
|
//Code ENDE
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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<string, string> dic = new();
|
||||||
|
|
||||||
|
//Code Start
|
||||||
|
|
||||||
|
//Code ENDE
|
||||||
|
|
||||||
|
Console.Write(dic["dieses"]);
|
||||||
|
Console.Write(dic["ist"]);
|
||||||
|
Console.Write(dic["Programm"]);
|
||||||
|
Console.Write(dic["es"]);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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<string, string> dic = new();
|
||||||
|
|
||||||
|
//Code Start
|
||||||
|
|
||||||
|
//Code ENDE
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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<string, string> dic = new();
|
||||||
|
|
||||||
|
//Code Start
|
||||||
|
|
||||||
|
//Code ENDE
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue