add Programmyday form github

This commit is contained in:
Ruben Kallinich
2024-07-25 15:47:46 +02:00
parent 09c8eab938
commit 7362c3d7ce
132 changed files with 3669 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lohnabrechnung
{
internal class Angestellter : Lohnsklaven
{
private int alter;
private string? tarifgruppe;
public Angestellter(int alter, string? tarifgruppe, string? name, string? vorname)
{
this.alter = alter;
this.tarifgruppe = tarifgruppe;
this.name = name;
this.vorname = vorname;
hungerlohn();
}
public void hungerlohn()
{
if (tarifgruppe == "A" || tarifgruppe == "a")
{
this.gehalt = 2560 * (1 + ((this.alter - 25.0) / 100));
}
else if (tarifgruppe == "B" || tarifgruppe == "b")
{
this.gehalt = 3000 * (1 + ((this.alter - 25.0) / 100));
}
else if (tarifgruppe == "C" || tarifgruppe == "c")
{
this.gehalt = 3200 * (1 + ((this.alter - 25.0) / 100));
}
else if (tarifgruppe == "D" || tarifgruppe == "d")
{
this.gehalt = 5400 * (1 + ((this.alter - 25.0) / 100));
}
}
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lohnabrechnung
{
internal class ExternerMitarbeiter : Lohnsklaven
{
private int projektstunden;
public ExternerMitarbeiter(int projektstunden, string? name, string? vorname)
{
this.projektstunden = projektstunden;
this.name = name;
this.vorname = vorname;
Berechnung();
}
public void Berechnung()
{
this.gehalt = projektstunden * 75;
}
}
}

View File

@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lohnabrechnung
{
internal class Lohnsklaven
{
protected string? name;
protected string? vorname;
protected double gehalt;
public void DatenAusgabe()
{
if (this is Angestellter)
{
Console.WriteLine("Angestellter:");
}
else if(this is ExternerMitarbeiter)
{
Console.WriteLine("Externer Mitarbeiter:");
}
else if (this is Praktikant)
{
Console.WriteLine("Praktikant:");
}
Console.WriteLine($"Name: {name}");
Console.WriteLine($"Vorname: {vorname}");
Console.WriteLine($"Gehalt: {gehalt:C2}");
Console.WriteLine();
}
}
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Lohnabrechnung
{
internal class Praktikant : Lohnsklaven
{
private string? abteilung;
public Praktikant(string? abteilung, string? name, string? vorname)
{
this.abteilung = abteilung;
this.name = name;
this.vorname = vorname;
fußabtreter();
}
public void fußabtreter()
{
if (this.abteilung == "Entwicklung")
{ this.gehalt = 935; }
else if (this.abteilung == "Vertreib")
{ this.gehalt = 820; }
else if (this.abteilung == "Procuktion")
{ this.gehalt = 710; }
}
}
}

17
Lohnabrechnung/Program.cs Normal file
View File

@@ -0,0 +1,17 @@
using System.Threading.Channels;
namespace Lohnabrechnung
{
internal class Program
{
static void Main(string[] args)
{
Angestellter angestellter1 = new Angestellter(31,"B","Goldfisch","Robertus");
ExternerMitarbeiter externer = new ExternerMitarbeiter(900, "Lumpen", "Struppi");
Praktikant prakti = new Praktikant("Entwicklung", "Gans", "Gustav");
angestellter1.DatenAusgabe();
externer.DatenAusgabe();
prakti.DatenAusgabe();
}
}
}