diff --git "a/VL241025_Do_While_Qua\314\210lschleife/DoWhile.cs" "b/VL241025_Do_While_Qua\314\210lschleife/DoWhile.cs" new file mode 100644 index 0000000000000000000000000000000000000000..75b3e79dc37869352d0184399900ed3f9248b8f2 --- /dev/null +++ "b/VL241025_Do_While_Qua\314\210lschleife/DoWhile.cs" @@ -0,0 +1,13 @@ +bool eingabeGueltig; + +do +{ + Console.Write("1 oder 2 eingeben: "); + string eingabe = Console.ReadLine()!; + + eingabeGueltig = (eingabe == "1" || eingabe == "2"); + if (!eingabeGueltig) + Console.WriteLine("Falsche Eingabe. Wiederhole."); + +} while (!eingabeGueltig); + diff --git "a/VL241025_Do_While_Qua\314\210lschleife/VL241025_Do_While_Qu\303\244lschleife.csproj" "b/VL241025_Do_While_Qua\314\210lschleife/VL241025_Do_While_Qu\303\244lschleife.csproj" new file mode 100644 index 0000000000000000000000000000000000000000..206b89a9a8b9320db4b017a262b565f104489193 --- /dev/null +++ "b/VL241025_Do_While_Qua\314\210lschleife/VL241025_Do_While_Qu\303\244lschleife.csproj" @@ -0,0 +1,10 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + </PropertyGroup> + +</Project> diff --git "a/VL241028_Fakulta\314\210tsfunktion/Fakult\303\244t.cs" "b/VL241028_Fakulta\314\210tsfunktion/Fakult\303\244t.cs" new file mode 100644 index 0000000000000000000000000000000000000000..301a5b90457346d1ac712c223c229be05f953fc1 --- /dev/null +++ "b/VL241028_Fakulta\314\210tsfunktion/Fakult\303\244t.cs" @@ -0,0 +1,26 @@ +class Program +{ + // Berechnung n! + static int Fak(int n) + { + int ergebnis = 1; + + for (int i = 1; i <= n; i++) + { + ergebnis *= i; + } + + return ergebnis; + } + + static void Main(string[] args) + { + // Erfrage Zahl + Console.Write("Zahl eingeben: "); + int zahl = Convert.ToInt32(Console.ReadLine()); + + // Gib zahl! aus + int fak = Fak(zahl); + Console.WriteLine($"{zahl}! = {fak}"); + } +} diff --git "a/VL241028_Fakulta\314\210tsfunktion/VL241028_Fakult\303\244tsfunktion.csproj" "b/VL241028_Fakulta\314\210tsfunktion/VL241028_Fakult\303\244tsfunktion.csproj" new file mode 100644 index 0000000000000000000000000000000000000000..206b89a9a8b9320db4b017a262b565f104489193 --- /dev/null +++ "b/VL241028_Fakulta\314\210tsfunktion/VL241028_Fakult\303\244tsfunktion.csproj" @@ -0,0 +1,10 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>net8.0</TargetFramework> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + </PropertyGroup> + +</Project> diff --git a/VL250113_SyntaxChecker/SyntaxChecker.cs b/VL250113_SyntaxChecker/SyntaxChecker.cs index 5660c7ee0fa1e2ee361020129f1d01dd0957798c..5a979f92ff686b04a740d3cab03eb7e44e8595ec 100644 --- a/VL250113_SyntaxChecker/SyntaxChecker.cs +++ b/VL250113_SyntaxChecker/SyntaxChecker.cs @@ -14,7 +14,7 @@ Stellen Sie sicher, dass am Ende alle Klammern geschlossen sind. Wenn kein Fehler auftrat, soll eine Erfolgsmeldung ausgegeben werden. */ -internal class Program +class Program { private static void Main(string[] args) {