add Programmyday form github
This commit is contained in:
42
Lohnabrechnung/Angestellter.cs
Normal file
42
Lohnabrechnung/Angestellter.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
25
Lohnabrechnung/ExternerMitarbeiter.cs
Normal file
25
Lohnabrechnung/ExternerMitarbeiter.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
10
Lohnabrechnung/Lohnabrechnung.csproj
Normal file
10
Lohnabrechnung/Lohnabrechnung.csproj
Normal 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>
|
||||
35
Lohnabrechnung/Lohnsklaven.cs
Normal file
35
Lohnabrechnung/Lohnsklaven.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Lohnabrechnung/Praktikant.cs
Normal file
29
Lohnabrechnung/Praktikant.cs
Normal 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
17
Lohnabrechnung/Program.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user