Initial
This commit is contained in:
parent
e691965aee
commit
320d049e4b
28
.gitignore
vendored
28
.gitignore
vendored
@ -1,17 +1,3 @@
|
||||
# ---> VisualStudioCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
!.vscode/*.code-snippets
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
# Built Visual Studio Code Extensions
|
||||
*.vsix
|
||||
|
||||
# ---> VisualStudio
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
@ -412,3 +398,17 @@ FodyWeavers.xsd
|
||||
# JetBrains Rider
|
||||
*.sln.iml
|
||||
|
||||
# ---> VisualStudioCode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
!.vscode/*.code-snippets
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
.history/
|
||||
|
||||
# Built Visual Studio Code Extensions
|
||||
*.vsix
|
||||
|
||||
|
||||
26
.vscode/launch.json
vendored
Normal file
26
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
// Use IntelliSense to find out which attributes exist for C# debugging
|
||||
// Use hover for the description of the existing attributes
|
||||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
||||
"name": ".NET Core Launch (console)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/bin/Debug/net7.0/Exercises_C_Sharp_Lections.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}",
|
||||
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
|
||||
"console": "internalConsole",
|
||||
"stopAtEntry": false
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach"
|
||||
}
|
||||
]
|
||||
}
|
||||
41
.vscode/tasks.json
vendored
Normal file
41
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/Exercises_C_Sharp_Lections.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "publish",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/Exercises_C_Sharp_Lections.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"--project",
|
||||
"${workspaceFolder}/Exercises_C_Sharp_Lections.csproj"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
||||
17
Exercises/E01_Einleitung/Exercise_1.cs
Normal file
17
Exercises/E01_Einleitung/Exercise_1.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E01_Einleitung
|
||||
{
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass in der Konsole nicht das englische ‚Hello World!‘, sondern die deutsche Übersetzung ‚Hallo Welt!‘ ausgegeben wird.
|
||||
//Code START
|
||||
Console.WriteLine("Hello World!");
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Exercises/E01_Einleitung/Exercise_2.cs
Normal file
23
Exercises/E01_Einleitung/Exercise_2.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E01_Einleitung
|
||||
{
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Geben Sie diese nacheinander die Lösungen folgender Gleichungen jeweils in eigener Zeile in der Konsole aus:
|
||||
//24 + 14 – 34 / 12 * 2 % 4
|
||||
//23847 + 3333 / 34 * 22 – 12 + 2343234 % 6
|
||||
//123.34 / 2344.3 – 12035.55 / 4.9 * 123.2
|
||||
//948475.23423 * 7 – 23433.833 % 22.66 + 34.3 * 4
|
||||
//2343 – 3434.2 * 333.33 – 3333.88 / 77777.1 + 12.33 % 0.3336
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Exercises/E01_Einleitung/Exercise_3.cs
Normal file
29
Exercises/E01_Einleitung/Exercise_3.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E01_Einleitung
|
||||
{
|
||||
class Exercise_3
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Programmieren Sie folgende Anweisungen aus:
|
||||
|
||||
//Teilen Sie dreimal die Zahl 343 durch 7 und geben Sie das Ergebnis aus:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
//Nehmen Sie die Zahl 10 mal 4, addieren Sie dann die Zahl 17 darauf, teilen Sie dann das Ergebnis durch 3. Ziehen Sie zum Schluss noch 2 ab und geben Sie das Ergebnis aus:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
//Teilen Sie die Zahl 343 zweimal durch 7 und nehmen Sie die erhaltene Zahl Modulo 3. Geben Sie das Ergebnis aus:
|
||||
//Code Start
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Exercises/E01_Einleitung/Exercise_4.cs
Normal file
23
Exercises/E01_Einleitung/Exercise_4.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E01_Einleitung
|
||||
{
|
||||
class Exercise_4
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Geben Sie die Ergebnise der booleschen Werte nacheinander in eigener Zeile in der Konsole aus:
|
||||
//8374 + 1234 > 10522 - 2256
|
||||
//123 * 123 != 100 + 12523
|
||||
//756.055 / 299.25 >= 25 * 22
|
||||
//123 + 2562 / 4 <= 3874 + 56856
|
||||
//1234 % 4 * 526 / 25685 == 9374 + 85 * 36369 / 40252 % 256
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Exercises/E01_Einleitung/Exercise_5.cs
Normal file
29
Exercises/E01_Einleitung/Exercise_5.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E01_Einleitung
|
||||
{
|
||||
class Exercise_5
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Programmieren Sie folgende Anweisungen aus:
|
||||
|
||||
//Ist das Ergebnis von 100 / 3 größer als 3 mal 11? Lassen Sie diese Frage den Computer beantworten und geben das Ergebnis in einer extra Zeile aus:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
//Ist 1526 Modulo 12 kleiner als 1526 Modulo 16? Lassen Sie diese Frage den Computer beantworten und geben das Ergebnis in einer extra Zeile aus:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
//Kommt dasselbe Ergebnis heraus, wenn man 2152 durch acht teilt und wenn man von 500 231 subtrahiert? Lassen Sie diese Frage den Computer beantworten und geben das Ergebnis in einer extra Zeile aus:
|
||||
//Code Start
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Exercises/E02_Variablen/Exercise_1.cs
Normal file
28
Exercises/E02_Variablen/Exercise_1.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E02_Variablen
|
||||
{
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Um welche Variablentypen handelt es sich hier? Tauschen Sie den Wert dynamic durch den richtigen Typ aus:
|
||||
dynamic var1 = 343;
|
||||
dynamic var2 = -231;
|
||||
dynamic var3 = 'T';
|
||||
dynamic var4 = "T";
|
||||
dynamic var5 = "Hallo";
|
||||
dynamic var6 = " ";
|
||||
dynamic var7 = 123.34;
|
||||
dynamic var8 = 335.27364;
|
||||
dynamic var9 = 7483.291M;
|
||||
dynamic var10 = true;
|
||||
dynamic var11 = 3847M;
|
||||
dynamic var12 = 38493.28F;
|
||||
dynamic var13 = 8349.23;
|
||||
dynamic var14 = '\\';
|
||||
}
|
||||
}
|
||||
}
|
||||
26
Exercises/E02_Variablen/Exercise_2.cs
Normal file
26
Exercises/E02_Variablen/Exercise_2.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E02_Variablen
|
||||
{
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
string val1 = "Hallo, ";
|
||||
string val2 = "";
|
||||
string val3 = "geht's?";
|
||||
|
||||
//Sorgen Sie dafür, dass unten auf der Konsole "Hallo, wie geht's?" ausgegeben wird.
|
||||
//Code Start
|
||||
|
||||
//Code Ende
|
||||
|
||||
Console.Write(val1);
|
||||
Console.Write(val2);
|
||||
Console.Write(val3);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Exercises/E02_Variablen/Exercise_3.cs
Normal file
24
Exercises/E02_Variablen/Exercise_3.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E02_Variablen
|
||||
{
|
||||
class Exercise_3
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
int val1 = 156;
|
||||
int val2 = 7;
|
||||
int val3 = -12;
|
||||
|
||||
//Sorgen Sie dafür, dass unten auf der Konsole 101 ausgegeben wird.
|
||||
//Code Start
|
||||
|
||||
//Code Ende
|
||||
|
||||
Console.Write(val1 + val2 + val3);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Exercises/E02_Variablen/Exercise_4.cs
Normal file
25
Exercises/E02_Variablen/Exercise_4.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E02_Variablen
|
||||
{
|
||||
class Exercise_4
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
string val1 = "Das ";
|
||||
string val2 = " cool!";
|
||||
string val3 = "ist ";
|
||||
|
||||
//Geben Sie den Satz "Das ist cool!" auf der Konsole aus. Verwenden Sie ausschließlich Variablen:
|
||||
//Code Start
|
||||
val2 = val1;
|
||||
val3 = val2;
|
||||
val1 = val3;
|
||||
//Code Ende
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Exercises/E02_Variablen/Exercise_5.cs
Normal file
24
Exercises/E02_Variablen/Exercise_5.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E02_Variablen
|
||||
{
|
||||
class Exercise_5
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
double val1 = 123.456;
|
||||
double val2 = 789.101112;
|
||||
|
||||
//Geben Sie die Addition, die Subtraktion, die Division und die Multiplikation der beiden oeben Zahlen auf der Konsole aus:
|
||||
//Code Start
|
||||
val2 = val1;
|
||||
//Code Ende
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
43
Exercises/E02_Variablen/Exercise_6.cs
Normal file
43
Exercises/E02_Variablen/Exercise_6.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E02_Variablen
|
||||
{
|
||||
class Exercise_6
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
int var1 = 160;
|
||||
int var2 = 20;
|
||||
string hello = "Hallo und herzlich Willkommen!";
|
||||
string end = "Hier kommt das Ergebnis:";
|
||||
|
||||
|
||||
//Geben Sie zuerst beide String-Variablen in der richtigen Reihenfolge aus:
|
||||
//Code Start
|
||||
var1 = var2;
|
||||
hello = end;
|
||||
//Code Ende
|
||||
|
||||
//Geben Sie nun das Ergebnis folgender Operation aus: var1 soll durch var2 geteilt werden. Das Ergebnis soll dann durch zwei geteilt werden und mal var2 genommen werden. Dann soll davon var1 abgezogen werden und das dreifache von var2 addiert werden. Nehmen Sie das Ergebnis dann Modulo 27. Nutzen Sie dabei ausschließlich die Variablen!
|
||||
//Code Start
|
||||
|
||||
//Code Ende
|
||||
|
||||
//Ändern Sie nun die beiden Werte oben auf 3600 und 360:
|
||||
//Code Start
|
||||
|
||||
//Code Ende
|
||||
|
||||
//Machen Sie nun dieselben Operationen wie oben und geben Sie dann wiederum das Ergebnis aus:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Exercises/E02_Variablen/Exercise_7.cs
Normal file
23
Exercises/E02_Variablen/Exercise_7.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E02_Variablen
|
||||
{
|
||||
class Exercise_7
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Erstellen Sie zwei Variablen, sodass unten auf der Konsole "Dies ist Ihre Zahl: 123" ausgegeben wird.
|
||||
//Code START
|
||||
dynamic a = 1;
|
||||
dynamic b = 2;
|
||||
dynamic c = 3;
|
||||
//Code ENDE
|
||||
|
||||
Console.Write(a);
|
||||
Console.WriteLine(c);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Exercises/E02_Variablen/Exercise_8.cs
Normal file
29
Exercises/E02_Variablen/Exercise_8.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E02_Variablen
|
||||
{
|
||||
class Exercise_8
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
|
||||
//Erstellen Sie unten die drei Variablen richtig:
|
||||
//Code START
|
||||
dynamic firstValue;
|
||||
dynamic secondValue;
|
||||
dynamic thirdValue;
|
||||
//Code ENDE
|
||||
|
||||
firstValue = "Hier kommen die Zahlen:";
|
||||
secondValue = 456;
|
||||
thirdValue = 789.4585;
|
||||
|
||||
Console.WriteLine(firstValue);
|
||||
Console.WriteLine(secondValue);
|
||||
Console.WriteLine(thirdValue);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Exercises/E02_Variablen/Exercise_9.cs
Normal file
32
Exercises/E02_Variablen/Exercise_9.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E02_Variablen
|
||||
{
|
||||
class Exercise_9
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass die Zahl 2736.938 unten auf der Konsole ausgegeben wird.
|
||||
|
||||
//Code START
|
||||
double d1 = 2634.37263;
|
||||
double d2 = 237384.2832;
|
||||
double d3 = 663782.39283;
|
||||
//Code ENDE
|
||||
|
||||
d1 = d2 -d3;
|
||||
d2 = d3 / d1;
|
||||
d3 = d1 * d3;
|
||||
d1 = d3 / d2;
|
||||
d2 = d3 + d2;
|
||||
double d4 = d1 + d2 + d3;
|
||||
|
||||
//Code Start
|
||||
double d5 = 0;
|
||||
//Code Ende
|
||||
Console.WriteLine(d5 + d4 + d3 + d2 + d1);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Exercises/E03_Strings/Exercise_1.cs
Normal file
19
Exercises/E03_Strings/Exercise_1.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E03_Strings
|
||||
{
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass "Hallo, wie geht's?" unten auf der Konsole ausgegeben wird.
|
||||
//Code START
|
||||
dynamic s = -1;
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Exercises/E03_Strings/Exercise_10.cs
Normal file
28
Exercises/E03_Strings/Exercise_10.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E03_Strings
|
||||
{
|
||||
class Exercise_10
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole
|
||||
//"Das Erste kommt zuerst...
|
||||
//...und das Zweite kommt zuletzt."
|
||||
//ausgegeben wird
|
||||
|
||||
|
||||
//Code START
|
||||
string s1 = "";
|
||||
string s2 = "";
|
||||
string s3 = "";
|
||||
string s4 = "";
|
||||
//Code ENDE
|
||||
string s = string.Format("{0} Erste kommt zu{1}{2}das Zweite{3}zuletzt.", s2, s1, s4, s3);
|
||||
|
||||
Console.WriteLine(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
Exercises/E03_Strings/Exercise_11.cs
Normal file
22
Exercises/E03_Strings/Exercise_11.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E03_Strings
|
||||
{
|
||||
class Exercise_11
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole ein richtiger Satz ausgegeben wird.
|
||||
string s1 = "Piratenschiff";
|
||||
|
||||
//Code START
|
||||
string s2 = "";
|
||||
int i1 = -1;
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine($"Das Wort {s1} hat genau so viele Zeichen wie {s2}, nämlich {i1}.");
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Exercises/E03_Strings/Exercise_12.cs
Normal file
29
Exercises/E03_Strings/Exercise_12.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E03_Strings
|
||||
{
|
||||
class Exercise_12
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass nach der Eingabe ausgegeben wird, ob der eingegebene String ein A bzw. a besitzt, oder nicht.
|
||||
string s = Console.ReadLine() ?? "Irgendwas";
|
||||
bool b = false;
|
||||
|
||||
//CODE START
|
||||
|
||||
//CODE ENDE
|
||||
|
||||
if(b)
|
||||
{
|
||||
Console.WriteLine("Das Wort enthält den Buchstaben A.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Das Wort enthält nicht den Buchstaben A.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
Exercises/E03_Strings/Exercise_2.cs
Normal file
27
Exercises/E03_Strings/Exercise_2.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E03_Strings
|
||||
{
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Fügen Sie die Strings so zusammen, dass der Satz "Wie gut es ist, oder?" ausgegeben wird. Nutzen Sie wo es geht die folgenden Variablen:
|
||||
string s1 = "gut";
|
||||
string s2 = "wie";
|
||||
string s3 = "oder";
|
||||
string s4 = "Wie";
|
||||
string s5 = "es";
|
||||
string s6 = "ist";
|
||||
|
||||
|
||||
//Code START
|
||||
s2 = s3 = s4 = s5 = s6;
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine(s1);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
Exercises/E03_Strings/Exercise_3.cs
Normal file
22
Exercises/E03_Strings/Exercise_3.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E03_Strings
|
||||
{
|
||||
class Exercise_3
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Fügen Sie die Variable DasWarGemeint in den String ausgabeString anstatt der Stelle {0} ein:
|
||||
string DasWarGemeint = "Elefanten";
|
||||
string ausgabeString = "{0} sind die größten Landtiere.";
|
||||
|
||||
//Code START
|
||||
DasWarGemeint = ausgabeString;
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine(ausgabeString);
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Exercises/E03_Strings/Exercise_4.cs
Normal file
20
Exercises/E03_Strings/Exercise_4.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E03_Strings
|
||||
{
|
||||
class Exercise_4
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass der String userinput ohne führende und endende Leerzeichen ausgegeben wird:
|
||||
string userinput = " WERT ";
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine(userinput);
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Exercises/E03_Strings/Exercise_5.cs
Normal file
24
Exercises/E03_Strings/Exercise_5.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E03_Strings
|
||||
{
|
||||
class Exercise_5
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Geben Sie von folgenden Werten den vierten Buchstaben aus:
|
||||
string firstValue = "Brauerei";
|
||||
string secondValue = "Überbau";
|
||||
string thirdValue = "keinerlei";
|
||||
string fourthValue = "Fairness";
|
||||
|
||||
|
||||
//Code START
|
||||
firstValue = secondValue = thirdValue = fourthValue;
|
||||
//Code ENDE
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Exercises/E03_Strings/Exercise_6.cs
Normal file
28
Exercises/E03_Strings/Exercise_6.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E03_Strings
|
||||
{
|
||||
class Exercise_6
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass das erste Wort in Großbuchen und in Kleinbuchstaben ausgegeben wird.
|
||||
string val = "hAllIHaLlo";
|
||||
string small;
|
||||
string big;
|
||||
|
||||
|
||||
//Code START
|
||||
small = val;
|
||||
big = val;
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine("Kleinbuchstaben:");
|
||||
Console.WriteLine(small);
|
||||
Console.WriteLine("Großbuchstaben:");
|
||||
Console.WriteLine(big);
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Exercises/E03_Strings/Exercise_7.cs
Normal file
23
Exercises/E03_Strings/Exercise_7.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E03_Strings
|
||||
{
|
||||
class Exercise_7
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Extrahieren Sie aus dem folgenden String das Wort Polizei
|
||||
string val = " difjPolizei jidf das dielsaö";
|
||||
|
||||
|
||||
//Code START
|
||||
|
||||
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Exercises/E03_Strings/Exercise_8.cs
Normal file
25
Exercises/E03_Strings/Exercise_8.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E03_Strings
|
||||
{
|
||||
class Exercise_8
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass alle drei Strings in einer extra Zeile ausgegeben werden.
|
||||
string val = "Zeile 1";
|
||||
string val2 = "Zeile 2";
|
||||
string val3 = "Zeile 3";
|
||||
|
||||
|
||||
//Code START
|
||||
|
||||
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine(val + val2 + val3);
|
||||
}
|
||||
}
|
||||
}
|
||||
31
Exercises/E03_Strings/Exercise_9.cs
Normal file
31
Exercises/E03_Strings/Exercise_9.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E03_Strings
|
||||
{
|
||||
class Exercise_9
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Lassen Sie folgende Zeichen(folgen) auf der Konsole ausgeben:
|
||||
// - \
|
||||
// - \n
|
||||
// - \t
|
||||
// - "
|
||||
|
||||
|
||||
//Code START
|
||||
string val = "Element 1";
|
||||
string val2 = "Element 2";
|
||||
string val3 = "Element 3";
|
||||
string val4 = "Element 4";
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine(val);
|
||||
Console.WriteLine(val2);
|
||||
Console.WriteLine(val3);
|
||||
Console.WriteLine(val4);
|
||||
}
|
||||
}
|
||||
}
|
||||
21
Exercises/E04_Konsole/Exercise_1.cs
Normal file
21
Exercises/E04_Konsole/Exercise_1.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E04_Konsole
|
||||
{
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Geben Sie auf der Konsole "Hallo, wie geht es Ihnen?" aus.
|
||||
string s = "irgendwas?";
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
31
Exercises/E04_Konsole/Exercise_2.cs
Normal file
31
Exercises/E04_Konsole/Exercise_2.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E04_Konsole
|
||||
{
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass nach jedem Mal "Eingabe" drücken, der Text und der Hintergrund eine neue Farbe bekommt:
|
||||
Console.WriteLine("Hallo und herzlich Willkommen zum bunten Farbenspiel!");
|
||||
Console.WriteLine();
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine();
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine();
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Danke für die Nutzung!");
|
||||
Console.WriteLine();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
21
Exercises/E04_Konsole/Exercise_3.cs
Normal file
21
Exercises/E04_Konsole/Exercise_3.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E04_Konsole
|
||||
{
|
||||
class Exercise_3
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Auf der Konsole soll das ausgegeben werden, was der Anwender eingibt.
|
||||
|
||||
Console.WriteLine("Bitte geben Sie was ein:");
|
||||
//Code START
|
||||
string s = "irgendwas?";
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine("Ihre Eingabe war:\n" + s);
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Exercises/E04_Konsole/Exercise_4.cs
Normal file
35
Exercises/E04_Konsole/Exercise_4.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E04_Konsole
|
||||
{
|
||||
class Exercise_4
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Der Anwender soll auf der Konsole zwei Zahlen eingeben. Dann soll die Addition, die Subtraktion, die Division, die Multiplikation und das Modulo Ergebnis ausgegeben werden.
|
||||
double result = 0;
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Die Addition der Zahlen ist: {0}", result);
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Die Subtraktion der Zahlen ist: {0}", result);
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Die Division der Zahlen ist: {0}", result);
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Die Multiplikation der Zahlen ist: {0}", result);
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Das Modulo der Zahlen ist: {0}", result);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Exercises/E04_Konsole/Exercise_5.cs
Normal file
19
Exercises/E04_Konsole/Exercise_5.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E04_Konsole
|
||||
{
|
||||
class Exercise_5
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
string terminalName = string.Empty;
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Der Name der Konsole wurde auf '{0}' geändert!", terminalName);
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
35
Exercises/E04_Konsole/Exercise_6.cs
Normal file
35
Exercises/E04_Konsole/Exercise_6.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E04_Konsole
|
||||
{
|
||||
class Exercise_6
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sie sollen dafür sorgen, dass der Anwender zu Beginn eine Zahl eingibt. Danach soll diese Zahl bei jedem Tastendruck verdoppelt werden. Sorgen Sie dafür, dass dies 5 mal funktioniert.
|
||||
int userinput = 0;
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Die 1. Verdopplung ist {0}.", userinput);
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Die 2. Verdopplung ist {0}.", userinput);
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Die 3. Verdopplung ist {0}.", userinput);
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Die 4. Verdopplung ist {0}.", userinput);
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Die 5. Verdopplung ist {0}.", userinput);
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Exercises/E05_Arrays/Exercise_1.cs
Normal file
18
Exercises/E05_Arrays/Exercise_1.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E05_Arrays
|
||||
{
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Geben Sie alle Werte aus dem Array aus. Was fällt Ihnen auf?
|
||||
int[] intArray = new int[3];
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Exercises/E05_Arrays/Exercise_10.cs
Normal file
14
Exercises/E05_Arrays/Exercise_10.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E05_Arrays
|
||||
{
|
||||
class Exercise_10
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Exercises/E05_Arrays/Exercise_11.cs
Normal file
14
Exercises/E05_Arrays/Exercise_11.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E05_Arrays
|
||||
{
|
||||
class Exercise_11
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Exercises/E05_Arrays/Exercise_12.cs
Normal file
14
Exercises/E05_Arrays/Exercise_12.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E05_Arrays
|
||||
{
|
||||
class Exercise_12
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Exercises/E05_Arrays/Exercise_2.cs
Normal file
23
Exercises/E05_Arrays/Exercise_2.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E05_Arrays
|
||||
{
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Lassen Sie den Anwender fünf Strings eingeben und speichern Sie diese in diesem Array:
|
||||
string[] stringArray = new string[5];
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
//Geben Sie nun alle fünf String in dem Array mit Leerzeichen getrennt aus:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Exercises/E05_Arrays/Exercise_3.cs
Normal file
19
Exercises/E05_Arrays/Exercise_3.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E05_Arrays
|
||||
{
|
||||
class Exercise_3
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Geben Sie alle Zeichen in alphabetischer Reihenfolge auf der Konsole aus:
|
||||
char[] charArray = new char[]{ 'k', 'a', 'o', 'w', 'l', 'x', 't', 's'};
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
22
Exercises/E05_Arrays/Exercise_4.cs
Normal file
22
Exercises/E05_Arrays/Exercise_4.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E05_Arrays
|
||||
{
|
||||
class Exercise_4
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Auf der Konsole soll ausgegen werden, wie viele Elemente sich in dem Array befinden:
|
||||
int[] intArray = new int[]
|
||||
{123,23,43,123,4,122,43235,46,45645,756,7,58,56,74,5,634,56456,4,56,3457,4,57,56,75,6,856,85,67,45,74564356,45,645,6756876,98,98,978,97,80,790789,78,978,96,7,865786,57546,74,67,45,64,56,45,645,6,45,65,67567,567,4567,45,656,64565,64,56465,766,7,56,8,5678,7,8,67,9,678678,56,7,567,6,75,674565645,6,45,46,7,56,867,8,67,8,67,867,8,678,67,86786,78,98879,67,8,768,56,756,74,56,54,6,45,645,7,56,756,87,56,876,8,56,74,5,645,6,3,632,4,5,435,34,53,45,34,5,34,5,4,6745,67,34567,5,45,74,56,45,6,54,6,45,7,65,7,56,8,56,85,674567,56745,6,4,56,456,45645,6,3,45,3,4,5345345,34654,56,987,546,756,8,756,87,5,67,5467,45,6,354,64,57,45,7,4,6,45,6,45,6,34,6,4,65,34,6,457,45,7,658,67,9,2345,89,879780,87,0,80987,9,78,97,89,78,97,8,79,89789,78,9789,78,97897,89};
|
||||
|
||||
//Code START
|
||||
dynamic i = 0;
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine("Das Array hat {0} Elemente.", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Exercises/E05_Arrays/Exercise_5.cs
Normal file
23
Exercises/E05_Arrays/Exercise_5.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E05_Arrays
|
||||
{
|
||||
class Exercise_5
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Lassen Sie den Anwender fünf Decimal-Zahlen eingeben. Speichern Sie diese in das Array:
|
||||
decimal[] decimalArray = new decimal[5];
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
//Geben Sie nun die Summe aller Zahlen auf der Konsole aus:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Exercises/E05_Arrays/Exercise_6.cs
Normal file
25
Exercises/E05_Arrays/Exercise_6.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E05_Arrays
|
||||
{
|
||||
class Exercise_6
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Erstellen Sie ein Array, sodass unten eine wahre Aussage steht:
|
||||
//Code START
|
||||
dynamic arr = -1;
|
||||
//Code ENDE
|
||||
|
||||
arr[2] = 12;
|
||||
arr[0] = 32;
|
||||
|
||||
int i = arr[0] + arr[1] + arr[2];
|
||||
|
||||
Console.WriteLine("Teilt man Zahl {0} durch 57 kommt 1 heraus.", i);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Exercises/E05_Arrays/Exercise_7.cs
Normal file
14
Exercises/E05_Arrays/Exercise_7.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E05_Arrays
|
||||
{
|
||||
class Exercise_7
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Exercises/E05_Arrays/Exercise_8.cs
Normal file
14
Exercises/E05_Arrays/Exercise_8.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E05_Arrays
|
||||
{
|
||||
class Exercise_8
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Exercises/E05_Arrays/Exercise_9.cs
Normal file
14
Exercises/E05_Arrays/Exercise_9.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E05_Arrays
|
||||
{
|
||||
class Exercise_9
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Exercises/E06_Random/Exercise_1.cs
Normal file
19
Exercises/E06_Random/Exercise_1.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E06_Random
|
||||
{
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass eine Zufallszahl auf der Konsole ausgegeben wird.
|
||||
int i;
|
||||
//Code START
|
||||
i = -1;
|
||||
//Code ENDE
|
||||
Console.WriteLine(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Exercises/E06_Random/Exercise_2.cs
Normal file
19
Exercises/E06_Random/Exercise_2.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E06_Random
|
||||
{
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass eine Zufallszahl zwischen 1 und 10 ausgegeben wird.
|
||||
int i;
|
||||
//Code START
|
||||
i = -1;
|
||||
//Code ENDE
|
||||
Console.WriteLine(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
Exercises/E06_Random/Exercise_3.cs
Normal file
22
Exercises/E06_Random/Exercise_3.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E06_Random
|
||||
{
|
||||
class Exercise_3
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass eine Zufallszahl zwischen 0 und 45 ausgegeben wird.
|
||||
Random rand = new Random();
|
||||
int k;
|
||||
|
||||
//Code START
|
||||
k = -1;
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine(rand.Next() % k);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
Exercises/E06_Random/Exercise_4.cs
Normal file
22
Exercises/E06_Random/Exercise_4.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E06_Random
|
||||
{
|
||||
class Exercise_4
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass eine negative Zahl zwischen -120 und -10 auf der Konsole ausgegeben wird.
|
||||
|
||||
int i;
|
||||
|
||||
//Code START
|
||||
i = -1;
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Exercises/E06_Random/Exercise_5.cs
Normal file
23
Exercises/E06_Random/Exercise_5.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E06_Random
|
||||
{
|
||||
class Exercise_5
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass immer drei verschiedene Zufallszahlen ausgegeben werden.
|
||||
int[] intArray = new int[3];
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine("Zahl 1: " + intArray[0]);
|
||||
Console.WriteLine("Zahl 2: " + intArray[1]);
|
||||
Console.WriteLine("Zahl 3: " + intArray[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
Exercises/E06_Random/Exercise_6.cs
Normal file
22
Exercises/E06_Random/Exercise_6.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E06_Random
|
||||
{
|
||||
class Exercise_6
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Generieren Sie zufällig ein Wort mit 5 Zeichen. Der erste Buchstabe sollte groß geschrieben sein. (Tipp: Buchstaben sind auch nur Zahlen)
|
||||
|
||||
string s = string.Empty;
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
Console.WriteLine("Das neue Wort ist \"{0}\".", s);
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Exercises/E07_DateTime/Exercise_1.cs
Normal file
20
Exercises/E07_DateTime/Exercise_1.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole das heutige Datum ausgegeben wird.
|
||||
//Code START
|
||||
dynamic dt = -1;
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine(dt.ToString("dd.MM.yyyy"));
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Exercises/E07_DateTime/Exercise_2.cs
Normal file
20
Exercises/E07_DateTime/Exercise_2.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole die aktuelle Uhrzeit ausgegeben wird.
|
||||
int hour = 0;
|
||||
int minute = 0;
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("{0}:{1} Uhr", hour, minute);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Exercises/E07_DateTime/Exercise_3.cs
Normal file
19
Exercises/E07_DateTime/Exercise_3.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_3
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole der 13.02.1998 12:53:52 ausgegeben wird.
|
||||
//Code START
|
||||
dynamic dt = -1;
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine(dt.ToString("dd.MM.yyyy hh:mm:ss"));
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Exercises/E07_DateTime/Exercise_4.cs
Normal file
19
Exercises/E07_DateTime/Exercise_4.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_4
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole die Zahl 101 ausgegeben wird.
|
||||
DateTime dt = new DateTime(1,2,3,4,5,6);
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine(dt.Day + dt.Hour);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Exercises/E07_DateTime/Exercise_5.cs
Normal file
19
Exercises/E07_DateTime/Exercise_5.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_5
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Ziehen Sie von dem angegeben Datum eine Stunde ab und addieren Sie drei Tage drauf.
|
||||
DateTime dt = DateTime.Now;
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine(dt.ToString("dd.MM.yyyy hh:mm:ss"));
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Exercises/E07_DateTime/Exercise_6.cs
Normal file
18
Exercises/E07_DateTime/Exercise_6.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_6
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Zeigen Sie auf der Konsole die Millisekunden und die Microsekunden der aktuellen Uhrzeit an.
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Exercises/E07_DateTime/Exercise_7.cs
Normal file
20
Exercises/E07_DateTime/Exercise_7.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_7
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Wie viel Zeit liegt zwischen den beiden Daten? Geben Sie diese vollständig auf der Konsole aus (Jahr bis Sekunde).
|
||||
DateTime dt1 = new DateTime(1999, 12, 31, 11, 59, 59);
|
||||
DateTime dt2 = DateTime.Now;
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Exercises/E08_If/Exercise_1.cs
Normal file
41
Exercises/E08_If/Exercise_1.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass unten "Hello World!" ausgegeben wird.
|
||||
|
||||
//Code START
|
||||
dynamic b = -1;
|
||||
|
||||
//Code ENDE
|
||||
if(b)
|
||||
Console.Write("He");
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
if(!b)
|
||||
Console.Write("llo");
|
||||
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
if(b == true)
|
||||
Console.Write(" Worl");
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
if(b == false)
|
||||
Console.WriteLine("d!");
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Exercises/E08_If/Exercise_10.cs
Normal file
16
Exercises/E08_If/Exercise_10.cs
Normal file
@ -0,0 +1,16 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_10
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Geben Sie aus, wie viele freie Plätze das Array besitzt. Achten Sie auf die korrekte Grammatik. Sollte kein Element in dem Array sein, schreiben Sie auf die Konsole, dass kein Platz in dem Array frei ist.
|
||||
|
||||
int[] intArray = new int[new Random().Next(0,11)];
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Exercises/E08_If/Exercise_11.cs
Normal file
16
Exercises/E08_If/Exercise_11.cs
Normal file
@ -0,0 +1,16 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_11
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Die vom Nutzer eingegebene Zahl soll zwischen 10 und 100 liegen. Sollte die Zahl über 100 oder unter 10 liegen, geben Sie die unten stehende Fehlermeldung aus.
|
||||
|
||||
int userinput = Convert.ToInt32(Console.ReadLine());
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Die Zahl liegt leider außerhalb des Bereichs von 10 bis 100 und ist somit nicht valide...");
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Exercises/E08_If/Exercise_12.cs
Normal file
18
Exercises/E08_If/Exercise_12.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_12
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass überprüft wird, ob der Anwender eine Zahl eingegeben hat. Wenn das der Fall, geben Sie die Zahl aus, wenn nicht, dann schreiben Sie auf die Konsole, dass der eingegebene String X keine valide Zahl repräsentiert.
|
||||
|
||||
int k;
|
||||
string userinput = Console.ReadLine() ?? "";
|
||||
bool b = int.TryParse(userinput, out k);
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Exercises/E08_If/Exercise_13.cs
Normal file
18
Exercises/E08_If/Exercise_13.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_13
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole immer "Hallo!" ausgegeben wird.
|
||||
bool b = true;
|
||||
bool c = false;
|
||||
|
||||
|
||||
if(b /*Code START*/&&/*Code ENDE*/ c)
|
||||
Console.WriteLine("Hallo!");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
17
Exercises/E08_If/Exercise_14.cs
Normal file
17
Exercises/E08_If/Exercise_14.cs
Normal file
@ -0,0 +1,17 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_14
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Der Anwender soll hier zwei Zahlen eingeben. Sie sollen danach überprüfen, ob die erste Zahl durch die zweite Zahl teilbar ist. Geben Sie Ihr jeweiliges Resultat auf der Konsole aus.
|
||||
|
||||
int a = Convert.ToInt32(Console.ReadLine());
|
||||
int b = Convert.ToInt32(Console.ReadLine());
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
15
Exercises/E08_If/Exercise_15.cs
Normal file
15
Exercises/E08_If/Exercise_15.cs
Normal file
@ -0,0 +1,15 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_15
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//In diser if werden direkt zwei Zahlen vom Nutzer verlangt. Wenn dieser beide richtig eingibt, dann soll die Multiplikation beider Zahlen auf der Konsole ausgegeben werden. Wenn einer der Zahlen nicht korrekt ist, dann soll eine Fehlermeldung ausgegeben werden.
|
||||
|
||||
if(int.TryParse(Console.ReadLine(), out int a) && int.TryParse(Console.ReadLine(), out int b))
|
||||
//Code START
|
||||
Console.WriteLine();
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Exercises/E08_If/Exercise_16.cs
Normal file
18
Exercises/E08_If/Exercise_16.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_16
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Fragen Sie den User nach zwei decimal Zahlen.
|
||||
// - Gibt er beide richtig ein, dann soll die erste Zahl durch die zweite Zahl geteilt werden.
|
||||
// - Gibt er nur die erste richtig an, dann soll diese durch 7 geteilt werden.
|
||||
// - Gibt er nur die zweite richtig an, dann soll die Zahl 1937 durch diese Eingabe geteilt werden.
|
||||
// - Sind beide Eingaben falsch, dann soll eine 0 ausgegeben werden.
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
17
Exercises/E08_If/Exercise_17.cs
Normal file
17
Exercises/E08_If/Exercise_17.cs
Normal file
@ -0,0 +1,17 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_17
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Geben Sie auf der Konsole den Wert von der Eingabe i aus und lassen mit Hilfe vom String s dazuschreiben, ob die Zahl größer/gleich/kleiner 12 ist.
|
||||
|
||||
int i = Convert.ToInt32(Console.ReadLine());
|
||||
string s = i > 12 ? "größer 12" : i == 12 ? "gleich 12" : "kleiner 12";
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Exercises/E08_If/Exercise_18.cs
Normal file
19
Exercises/E08_If/Exercise_18.cs
Normal file
@ -0,0 +1,19 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_18
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Fragen Sie den Nutzer zuerst nach einer Integerzahl. Sorgen Sie dafür, dass das Programm bei Falscheingabe nicht abstürzt.
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
string s = string.Empty;
|
||||
//Füllen Sie nun den String s mit Hilfe eines SHORT-IF. Es soll überprüft und unten ausgegeben werden, ob die Zahl zwischen 0 und 10, zwischen 10 und 100, zwischen 100 und 1000 und über 1000 liegt.
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("Die eingegebene Zahl ist " + s);
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Exercises/E08_If/Exercise_2.cs
Normal file
14
Exercises/E08_If/Exercise_2.cs
Normal file
@ -0,0 +1,14 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass niemals "Hey" ausgegeben wird.
|
||||
//Code START
|
||||
if(true)
|
||||
//Code ENDE
|
||||
Console.WriteLine("Hey");
|
||||
}
|
||||
}
|
||||
}
|
||||
22
Exercises/E08_If/Exercise_3.cs
Normal file
22
Exercises/E08_If/Exercise_3.cs
Normal file
@ -0,0 +1,22 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_3
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass die beiden Berechnungen gemacht und die Ergebnise ausgegeben werden.
|
||||
int i = 123;
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
if(i > 1000)
|
||||
Console.WriteLine(i / 100);
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
if(!(i > 1000))
|
||||
Console.WriteLine(i * 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
17
Exercises/E08_If/Exercise_4.cs
Normal file
17
Exercises/E08_If/Exercise_4.cs
Normal file
@ -0,0 +1,17 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_4
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass der String "Passt!" immer ein einziges Mal ausgegeben wird, egal welcher Wert für i gesetzt wird. (Sie dürfen diesen natürlich testweise ändern.)
|
||||
|
||||
int i = 123;
|
||||
if(i < 100)
|
||||
Console.WriteLine("Passt!");
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Exercises/E08_If/Exercise_5.cs
Normal file
18
Exercises/E08_If/Exercise_5.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_5
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Lassen Sie den Computer die folgenden Boolschen Werte berechnen. Geben Sie dabei immer aus, ob die Aussage Wahr oder Falsch ist:
|
||||
//123 / 12 > 124 /13
|
||||
//123 + 123 == 321 - 123
|
||||
//1234 / 56 > 7 * 12
|
||||
//10000 % 12 <= 2000 % 23
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
15
Exercises/E08_If/Exercise_6.cs
Normal file
15
Exercises/E08_If/Exercise_6.cs
Normal file
@ -0,0 +1,15 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_6
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Geben Sie "Es ist richtig!" auf der Konsole aus, wenn die Aussage richtig ist und "Es ist falsch!" wenn die Aussage falsch ist.
|
||||
|
||||
if(123 * 12 / 85 % 88 < 123 * 13 / 86 % 77)
|
||||
//Code START
|
||||
Console.WriteLine();
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Exercises/E08_If/Exercise_7.cs
Normal file
16
Exercises/E08_If/Exercise_7.cs
Normal file
@ -0,0 +1,16 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_7
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Geben Sie die erstellte Zahl num auf der Konsole aus. Schreiben Sie dazu, ob die Zahl größer, kleiner oder gleich 500 ist.
|
||||
|
||||
int num = new Random().Next(0,1001);
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Exercises/E08_If/Exercise_8.cs
Normal file
14
Exercises/E08_If/Exercise_8.cs
Normal file
@ -0,0 +1,14 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_8
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Es heißt als Sprichwort "Kein Bier vor vier". Schreiben Sie ein Programm, welches überprüft, ob es schon nach 4 Uhr Nachmittags (also 16 Uhr) ist. Wenn das der Fall ist, geben Sie auf der Konsole "Sie dürfen ein Bier trinken" aus. Ansonsten geben Sie "Sie dürfen gerade kein Bier trinken" aus.
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Exercises/E08_If/Exercise_9.cs
Normal file
16
Exercises/E08_If/Exercise_9.cs
Normal file
@ -0,0 +1,16 @@
|
||||
namespace Exercises_C_Sharp.E08_If
|
||||
{
|
||||
class Exercise_9
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Analysieren Sie den String userinput. Hat dieser über 20 Zeichen, geben Sie aus, dass der String zu lang sei, hat er kein Zeichen, dass der String zu kurz sei. Liegt die Größe dazwischen, geben Sie aus, dass die Länge X so passt.
|
||||
|
||||
string userinput = Console.ReadLine() ?? "";
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Exercises/E09_Flowchart/Exercise_1.cs
Normal file
16
Exercises/E09_Flowchart/Exercise_1.cs
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
// Der User soll einen String eingeben. Wenn es sich bei diesem String um eine Zahl handelt, soll diese durch zwei geteilt und ausgegeben werden. Wenn es sich dabei um keine Zahl handelt, soll die Länge durch zwei geteilt werden und dieses Ergebnis ausgegeben werden.
|
||||
// 1. Zeichnen Sie obrige Aufgabe in einem Flowchart.
|
||||
// 2. Programmieren Sie die Aufgabe aus:
|
||||
|
||||
namespace Exercises_C_Sharp.E09_Flowchart;
|
||||
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
16
Exercises/E09_Flowchart/Exercise_2.cs
Normal file
16
Exercises/E09_Flowchart/Exercise_2.cs
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
// Lassen Sie den User 5 Integer-Werte in ein Array eingeben. Löschen Sie dann die Konsole und überprüfen Sie jeden Wert, ob dieser durch 7 Teilbar ist oder nicht. Wenn dieser durch 7 teilbar ist, dann schreiben Sie das auf die Konsole. Wenn der Wert nicht durch 7 teilbar ist, dann schreiben Sie das auch auf die Konsole und geben Sie den Rest auf der Konsole aus.
|
||||
// 1. Zeichnen Sie obrige Aufgabe in einem Flowchart.
|
||||
// 2. Programmieren Sie die Aufgabe aus:
|
||||
|
||||
namespace Exercises_C_Sharp.E09_Flowchart;
|
||||
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
43
Exercises/E10_SwitchCase/Exercise_1.cs
Normal file
43
Exercises/E10_SwitchCase/Exercise_1.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E10_SwitchCase
|
||||
{
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole "Hällow Wörlt!" ausgegeben wird.
|
||||
//Code START
|
||||
dynamic val = 0000000d;
|
||||
//Code ENDE
|
||||
|
||||
switch(val)
|
||||
{
|
||||
case 12.2:
|
||||
Console.WriteLine("Hallo Welt!");
|
||||
break;
|
||||
case 22.9:
|
||||
Console.WriteLine("Hello World!");
|
||||
break;
|
||||
case 37.669:
|
||||
Console.WriteLine("Saluton Mondo!");
|
||||
break;
|
||||
case 889.5521:
|
||||
Console.WriteLine("Hällow Wörlt!");
|
||||
break;
|
||||
case 21.52236:
|
||||
Console.WriteLine("سلام دنیا!");
|
||||
break;
|
||||
case 216.2236:
|
||||
Console.WriteLine("Halo Dunia!");
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Falsch!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
Exercises/E10_SwitchCase/Exercise_2.cs
Normal file
27
Exercises/E10_SwitchCase/Exercise_2.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E10_SwitchCase
|
||||
{
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass der User eine Zahl eingeben kann:
|
||||
//Code START
|
||||
int number = -1;
|
||||
//Code ENDE
|
||||
|
||||
//Geben Sie bei der Zahl 0 aus, dass Ihre Operation mit 0 nicht möglich ist, bei der 1, 2 und 3, dass diese Zahlen zu klein sind. Bei allen anderen Zahlen geben Sie dies eingegebene Zahl mal 12 aus:
|
||||
switch(number)
|
||||
{
|
||||
//Code START
|
||||
default:
|
||||
break;
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
Exercises/E10_SwitchCase/Exercise_3.cs
Normal file
27
Exercises/E10_SwitchCase/Exercise_3.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E10_SwitchCase
|
||||
{
|
||||
class Exercise_3
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Fragen Sie dem User nach seiner Lieblingsmusikrichtung und speichern Sie diese in einen String:
|
||||
//Code START
|
||||
string userFavourite = string.Empty;
|
||||
//Code ENDE
|
||||
|
||||
//Wenn der User eine Musikrichtung eingegeben hat, die Sie auch mögen, dann geben Sie das aus. Sollte die eingegebene Musikrichtung mit keiner übereinstimmen, dann geben Sie diese auch aus.
|
||||
switch(userFavourite)
|
||||
{
|
||||
//Code START
|
||||
default:
|
||||
break;
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
Exercises/E10_SwitchCase/Exercise_4.cs
Normal file
27
Exercises/E10_SwitchCase/Exercise_4.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E10_SwitchCase
|
||||
{
|
||||
class Exercise_4
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sie haben als Arbeitsanweisung bekommen, für eine Terminalsoftware Keywords zu verarbeiten. Lassen Sie dafür den User ein Keyword eingeben:
|
||||
//Code START
|
||||
string keyword = string.Empty;
|
||||
//Code ENDE
|
||||
|
||||
//Als Keywords sind verfügbar SELECT, INSERT, ADD, MUL, REMOVE, CANCEL. Verarbeiten Sie diese Keyword und geben sie auf der Konsole aus, welches Keyword eingegeben wurde. Sollte keines dieser Keywords eingegeben worden sein, geben Sie aus, dass die Eingabe nicht erkannt werden konnte. Groß-/Kleinschreibung soll keine Rolle spielen.
|
||||
switch(keyword)
|
||||
{
|
||||
//Code START
|
||||
default:
|
||||
break;
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Exercises/E11_For/Exercise_1.cs
Normal file
23
Exercises/E11_For/Exercise_1.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For
|
||||
{
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole 7 ausgegeben wird:
|
||||
//Code START
|
||||
string s = string.Empty;
|
||||
//Code ENDE
|
||||
|
||||
int counter = 0;
|
||||
for(int i = 0; i < s.Length; i++)
|
||||
counter++;
|
||||
Console.WriteLine(counter);
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Exercises/E11_For/Exercise_10.cs
Normal file
29
Exercises/E11_For/Exercise_10.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For;
|
||||
|
||||
class Exercise_10
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
int[] intArray = [12, 45, 56, 23, 56, 345, 56, 56];
|
||||
|
||||
//Geben Sie mit Hilfe der For-Schleife alle Zahlen im Array aus:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
//Multiplizieren Sie mit Hilfe der For-Schleife alle Zahlen im Array mit 2:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
//Geben Sie nun mit Hilfe der For-Schleife alle Zahlen im Array aus:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
23
Exercises/E11_For/Exercise_11.cs
Normal file
23
Exercises/E11_For/Exercise_11.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For;
|
||||
|
||||
class Exercise_11
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
int[] intArray = [12, 45, 56, 23, 56, 345, 56, 56];
|
||||
|
||||
//Lösen Sie die vorherige Aufgabe mit nur einer For-Schleife:
|
||||
// - Geben Sie mit Hilfe der For-Schleife alle Zahlen im Array aus:
|
||||
// - Multiplizieren Sie mit Hilfe der For-Schleife alle Zahlen im Array mit 2:
|
||||
// - Geben Sie nun mit Hilfe der For-Schleife alle Zahlen im Array aus:
|
||||
//Code START
|
||||
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
22
Exercises/E11_For/Exercise_12.cs
Normal file
22
Exercises/E11_For/Exercise_12.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Dynamic;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For;
|
||||
|
||||
class Exercise_12
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
|
||||
//Geben Sie auf der Konsole alle Zahlen von 1 bis 10 aus:
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
26
Exercises/E11_For/Exercise_13.cs
Normal file
26
Exercises/E11_For/Exercise_13.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Dynamic;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For;
|
||||
|
||||
class Exercise_13
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
int[] intArr = [2, 5, 1, 4, 6];
|
||||
string[] stringArr = ["Hallo", "Hey", "Hi", "Hoho", "Gogogo"];
|
||||
|
||||
//Sie sehen oben zwei Arrays. Das erste Array gibt an, wie oft Sie einen Wert aus dem zweiten Array (an der jeweiligen Stelle) ausgeben sollen. So sollen Sie "Hallo" 2x ausgeben, "Hey" 5x usw. Versuchen Sie, dies unabhängig von den Werten mit einer geschachtelten for-Schleife zu programmieren.
|
||||
|
||||
|
||||
//Code START
|
||||
|
||||
Console.WriteLine(intArr);
|
||||
Console.WriteLine(stringArr);
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
24
Exercises/E11_For/Exercise_14.cs
Normal file
24
Exercises/E11_For/Exercise_14.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Dynamic;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For;
|
||||
|
||||
class Exercise_14
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
int[] intArr = [2, 5, 1, -4, 6, 4, -5, 3, -2];
|
||||
|
||||
//Sie sehen oben ein Array mit Zahlen. Sie sollen nun von jeder Zahl bis 0 zählen. Versuchen Sie wieder, dies unabhängig von den Werten mit einer geschachtelten for-Schleife zu programmieren.
|
||||
|
||||
|
||||
//Code START
|
||||
|
||||
Console.WriteLine(intArr);
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
21
Exercises/E11_For/Exercise_2.cs
Normal file
21
Exercises/E11_For/Exercise_2.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For
|
||||
{
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole "Hallo" ausgegeben wird:
|
||||
//Code START
|
||||
string s = string.Empty;
|
||||
//Code ENDE
|
||||
|
||||
for(int i = s.Length -1; i > 0; i--)
|
||||
Console.Write(s[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
Exercises/E11_For/Exercise_3.cs
Normal file
22
Exercises/E11_For/Exercise_3.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For;
|
||||
|
||||
class Exercise_3
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Lassen Sie den User eine Zahl eingeben:
|
||||
//Code START
|
||||
int userinput = -1;
|
||||
//Code ENDE
|
||||
|
||||
//Geben Sie so oft auf der Konsole das Wort "Hallo!" mit Hilfe einer For-Schleife aus:
|
||||
//Code START
|
||||
userinput *= -1;
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
27
Exercises/E11_For/Exercise_4.cs
Normal file
27
Exercises/E11_For/Exercise_4.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For;
|
||||
|
||||
class Exercise_4
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Lassen Sie den User eine Zahl eingeben:
|
||||
//Code START
|
||||
int userinput = -1;
|
||||
//Code ENDE
|
||||
|
||||
//Überprüfen Sie die Zahl, ob diese zwischen 1 und 100 liegt
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
//Wenn die Zahl in dem Bereich liegt, dann geben Sie alle Zahlen von 0 bis zu dieser Zahl auf der Konsole aus:
|
||||
//Code START
|
||||
userinput *= -1;
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
27
Exercises/E11_For/Exercise_5.cs
Normal file
27
Exercises/E11_For/Exercise_5.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For;
|
||||
|
||||
class Exercise_5
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Lassen Sie den User eine Zahl eingeben:
|
||||
//Code START
|
||||
int userinput = -1;
|
||||
//Code ENDE
|
||||
|
||||
//Überprüfen Sie die Zahl, ob diese zwischen 1 und 100 liegt
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
//Wenn die Zahl in dem Bereich liegt, dann geben Sie alle Zahlen von dieser Zahl bis 0 auf der Konsole aus:
|
||||
//Code START
|
||||
userinput *= -1;
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
19
Exercises/E11_For/Exercise_6.cs
Normal file
19
Exercises/E11_For/Exercise_6.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For;
|
||||
|
||||
class Exercise_6
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
int[] intArray = [12, 45, 56, 23, 56, 345, 56, 56];
|
||||
|
||||
//Geben Sie alle Zahlen im obrigen Array mit Hilfe der For-Schleife auf der Konsole aus
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
19
Exercises/E11_For/Exercise_7.cs
Normal file
19
Exercises/E11_For/Exercise_7.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For;
|
||||
|
||||
class Exercise_7
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
string[] intArray = ["Hallo", "Hey", "Hi", "Grüß Gott", "Guten Morgen", "Guten Tag", "Servus", "Ciao"];
|
||||
|
||||
//Geben Sie alle Zahlen im obrigen Array mit Hilfe der For-Schleife nummeriert von 1 bis 8 auf der Konsole aus:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
19
Exercises/E11_For/Exercise_8.cs
Normal file
19
Exercises/E11_For/Exercise_8.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For;
|
||||
|
||||
class Exercise_8
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
int[] intArray = [12, 45, 56, 23, 56, 345, 56, 56];
|
||||
|
||||
//Bilden Sie die Summe der Zahlen oben mit einer For-Schleife und geben Sie diese auf der Konsole aus:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
22
Exercises/E11_For/Exercise_9.cs
Normal file
22
Exercises/E11_For/Exercise_9.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E11_For;
|
||||
|
||||
class Exercise_9
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Lassen Sie dem User eine Zahl zwischen 1 und 15 eingeben:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
//Multiplizieren Sie dann die Zahl 2 mit Hilfe einer For-Schleife so oft mit sich selber, wie vom User oben eingegeben, und geben Sie dann das Ergebnis aus:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
23
Exercises/E12_ResizeArrays/Exercise_1.cs
Normal file
23
Exercises/E12_ResizeArrays/Exercise_1.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E12_ResizeArray
|
||||
{
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
int[] arr = [13, 34, 234, 12, 345, 34];
|
||||
|
||||
//Fügen Sie dem oberen Array die Zahl 155 hinzu:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
for(int i = 0; i < arr.Length; i++)
|
||||
Console.Write(arr[i] + " - ");
|
||||
}
|
||||
}
|
||||
}
|
||||
27
Exercises/E12_ResizeArrays/Exercise_2.cs
Normal file
27
Exercises/E12_ResizeArrays/Exercise_2.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E12_ResizeArray
|
||||
{
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
Random rand = new();
|
||||
int random = rand.Next(5,20);
|
||||
int[] arr = new int[random];
|
||||
for(int i = 0; i < random; i++)
|
||||
arr[i] = rand.Next(1,1000);
|
||||
|
||||
//Oben wir ein zufälliges Array erstellt. Sorgen Sie dafür, dass den Array eine zufällige Zahl hinzugefügt wird:
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
|
||||
for(int i = 0; i < arr.Length; i++)
|
||||
Console.Write(arr[i] + " - ");
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user