Skip to content

Commit

Permalink
Aufgabe 8 bearbeitet und fertiggestellt.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Leon Dyga committed Nov 24, 2022
1 parent 44cba39 commit 50cc9c9
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 6 deletions.
21 changes: 17 additions & 4 deletions 5TreuePrämie/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,33 @@
double Prämie;
Console.WriteLine("Seit wielange arbeiten sie schon?(In jahre)");
double Jahre = Convert.ToDouble(Console.ReadLine());
double Prmie;
if (Jahre < 10)
{
switch (Jahre)
{
case < 3:
Console.WriteLine($"Keine Prämie");
Prmie = 0;
Console.WriteLine($"Prämie = {Prmie:C2} Euro pro Jahr");
break;
case >= 3:
Console.WriteLine($"Prämie = 150 Euro pro Jahr");
Prmie = 150;
Prmie = 150 * (Jahre-2);
Console.WriteLine($"Prämie = {Prmie:C2} Euro pro Jahr");
break;
}
}
if (Jahre > 10)
double Zähler = Jahre - 9;
double Prm = 150;
if (Jahre >= 10)
{
Prämie = ((Jahre - 10) * 10)+150;
Prämie = 1050;
while (Zähler > 0)
{
Prm += 10;
Prämie += Prm;
--Zähler;

}
Console.WriteLine($"Ihre Prämie liegt bei {Prämie:C2} im Jahr");
}
2 changes: 1 addition & 1 deletion 7WochenTage/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
Ergebniss = "Freitag";
break;
case 7:
Ergebniss = "Samsatag";
Ergebniss = "Samstag";
break;
}
Console.WriteLine($"Der wochentag lautet: {Ergebniss}");
11 changes: 11 additions & 0 deletions 8Array/8Array.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>_8Array</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
49 changes: 49 additions & 0 deletions 8Array/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
double[] Gehaltsstufe = new double[10] { 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 };
Console.WriteLine("Vordiensjahre rechner");
Console.WriteLine("Wieviel Vordiensjahre haben sie?");
double Vordienstzeit = Convert.ToDouble(Console.ReadLine());
double gehalt = 0;

if (Vordienstzeit == 0)
{
Vordienstzeit += 1;
}
if (Vordienstzeit > 10)
{
Vordienstzeit = 10;
}

switch (Vordienstzeit)
{
case 1:
gehalt = Gehaltsstufe[0];
break;
case 2:
gehalt = Gehaltsstufe[1];
break;
case 3:
gehalt = Gehaltsstufe[2];
break;
case 4:
gehalt = Gehaltsstufe[3];
break;
case 5:
gehalt = Gehaltsstufe[4];
break;
case 6:
gehalt = Gehaltsstufe[5];
break;
case 7:
gehalt = Gehaltsstufe[6];
break;
case 8:
gehalt = Gehaltsstufe[7];
break;
case 9:
gehalt = Gehaltsstufe[8];
break;
case 10:
gehalt = Gehaltsstufe[9];
break;
}
Console.WriteLine($"{gehalt:C2}");
8 changes: 7 additions & 1 deletion GrundlagenCSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "5TreuePrämie", "5TreuePrä
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "6Sinus", "6Sinus\6Sinus.csproj", "{24B19179-F743-4474-A5D4-B08D9A7AA5FD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "7WochenTage", "7WochenTage\7WochenTage.csproj", "{0822DDD4-92F9-4FB0-A595-B18F1DCCA99F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "7WochenTage", "7WochenTage\7WochenTage.csproj", "{0822DDD4-92F9-4FB0-A595-B18F1DCCA99F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "8Array", "8Array\8Array.csproj", "{367A4505-1F96-47EE-B78F-A7828270BB51}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -51,6 +53,10 @@ Global
{0822DDD4-92F9-4FB0-A595-B18F1DCCA99F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0822DDD4-92F9-4FB0-A595-B18F1DCCA99F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0822DDD4-92F9-4FB0-A595-B18F1DCCA99F}.Release|Any CPU.Build.0 = Release|Any CPU
{367A4505-1F96-47EE-B78F-A7828270BB51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{367A4505-1F96-47EE-B78F-A7828270BB51}.Debug|Any CPU.Build.0 = Debug|Any CPU
{367A4505-1F96-47EE-B78F-A7828270BB51}.Release|Any CPU.ActiveCfg = Release|Any CPU
{367A4505-1F96-47EE-B78F-A7828270BB51}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 50cc9c9

Please sign in to comment.