E24 Ex 1-6
This commit is contained in:
parent
062c3303b8
commit
6acc6db249
@ -9,7 +9,7 @@ namespace Exercises_C_Sharp.E24_Enumns
|
||||
public static void Start()
|
||||
{
|
||||
//Code Start
|
||||
|
||||
PrintAnimal(ConsoleColor.White, ConsoleColor.Magenta);
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
|
||||
@ -11,7 +11,10 @@ namespace Exercises_C_Sharp.E24_Enumns
|
||||
public static void Start()
|
||||
{
|
||||
//Code Start
|
||||
|
||||
for (int i = 0; i < 3; i++) Going(Direction.North);
|
||||
for (int i = 0; i < 5; i++) Going(Direction.East);
|
||||
for (int i = 0; i < 5; i++) Going(Direction.South);
|
||||
for (int i = 0; i < 4; i++) Going(Direction.West);
|
||||
//Code Ende
|
||||
}
|
||||
static int x = 0;
|
||||
|
||||
@ -19,6 +19,36 @@ namespace Exercises_C_Sharp.E24_Enumns
|
||||
static void ShowForm(SpecialForms a)
|
||||
{
|
||||
//Code START
|
||||
if (a == SpecialForms.Dreieck)
|
||||
{
|
||||
Console.WriteLine(" *");
|
||||
Console.WriteLine(" ***");
|
||||
Console.WriteLine("*****");
|
||||
Console.WriteLine(" ");
|
||||
}
|
||||
else if (a == SpecialForms.Quadrat)
|
||||
{
|
||||
Console.WriteLine("*****");
|
||||
Console.WriteLine("*****");
|
||||
Console.WriteLine("*****");
|
||||
Console.WriteLine(" ");
|
||||
}
|
||||
else if (a == SpecialForms.Rechteck)
|
||||
{
|
||||
Console.WriteLine("***********************************");
|
||||
Console.WriteLine("***********************************");
|
||||
Console.WriteLine("***********************************");
|
||||
Console.WriteLine("***********************************");
|
||||
Console.WriteLine(" ");
|
||||
}
|
||||
else if (a == SpecialForms.Kreis)
|
||||
{
|
||||
Console.WriteLine(" ******* ");
|
||||
Console.WriteLine("** **");
|
||||
Console.WriteLine("* *");
|
||||
Console.WriteLine(" ** **");
|
||||
Console.WriteLine(" ******* ");
|
||||
}
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
|
||||
@ -15,9 +15,9 @@ namespace Exercises_C_Sharp.E24_Enumns
|
||||
int i3 = -1;
|
||||
|
||||
//Code Start
|
||||
i1 = -1;
|
||||
i2 = -1;
|
||||
i3 = -1;
|
||||
i1 = 4;
|
||||
i2 = 1;
|
||||
i3 = 6;
|
||||
//Code Ende
|
||||
|
||||
Greetings g1 = (Greetings)i1;
|
||||
|
||||
@ -8,7 +8,8 @@ namespace Exercises_C_Sharp.E24_Enumns
|
||||
//Sorgen Sie dafür, dass die Zahl 325 ausgegeben wird.
|
||||
|
||||
//Code START
|
||||
enum Something{ Dies, ist, ein, Enum, mit, einem, Wert }
|
||||
enum Something{ Dies, ist = 5, ein = 20, Enum, mit, einem = 100, Wert = 200 }
|
||||
// ALTERNATIV: enum Something{ Dies, ist, ein, Enum, mit, einem, Wert = 317 }
|
||||
//Code ENDE
|
||||
|
||||
public static void Start()
|
||||
|
||||
@ -13,7 +13,7 @@ namespace Exercises_C_Sharp.E24_Enumns
|
||||
int res = (int)GivenName.Gerda;
|
||||
|
||||
//Code START
|
||||
res += -1;
|
||||
res += -44;
|
||||
//Code ENDE
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
@ -24,11 +24,11 @@ namespace Exercises_C_Sharp.E24_Enumns
|
||||
|
||||
Console.WriteLine(((GivenName)res).ToString());
|
||||
//Code START
|
||||
res += -1;
|
||||
res = 57;
|
||||
//Code ENDE
|
||||
Console.WriteLine(((GivenName)res).ToString());
|
||||
//Code START
|
||||
res += -1;
|
||||
res = 25;
|
||||
//Code ENDE
|
||||
Console.WriteLine(((GivenName)res).ToString());
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ namespace Exercises_C_Sharp.E28_Classes
|
||||
Console.WriteLine("Davor: " + element.IntegerList.Last());
|
||||
Console.WriteLine("Danach: " + element.IntegerList[i+1]);
|
||||
}
|
||||
else if(i == element.IntegerList.Length - 1)
|
||||
else if(i == element.IntegerList.Count - 1)
|
||||
{
|
||||
Console.WriteLine("Davor: " + element.IntegerList[i-1]);
|
||||
Console.WriteLine("Danach: " + element.IntegerList.First());
|
||||
|
||||
@ -51,7 +51,7 @@ namespace Exercises_C_Sharp.E28_Classes
|
||||
//Code ENDE
|
||||
}
|
||||
//"Einfache" Weg Sortierung
|
||||
Ausweise.Sort((k, l) => k.Birth.CompareTo(l.Birth));
|
||||
//Ausweise.Sort((k, l) => k.Birth.CompareTo(l.Birth));
|
||||
|
||||
//Geben Sie in diser Methode alle Ausweise optisch ansprechend auf der Konsole aus.
|
||||
static void ShowIDs(List<ID> idList)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user