add Programmyday form github
This commit is contained in:
47
LohnabrechnungMusterlösung/Angstellter.cs
Normal file
47
LohnabrechnungMusterlösung/Angstellter.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LohnabrechnungMusterlösung
|
||||
{
|
||||
enum Tarigruppe
|
||||
{
|
||||
A, B, C, D
|
||||
}
|
||||
internal class Angstellter : Mitarbeiter
|
||||
{
|
||||
private int alter;
|
||||
private Tarigruppe tarigruppe;
|
||||
|
||||
public Angstellter(string? vorname, string? nachname, int alter, Tarigruppe tarigruppe) : base(vorname, nachname)
|
||||
{
|
||||
this.vorname = vorname;
|
||||
this.nachname = nachname;
|
||||
this.alter = alter;
|
||||
this.tarigruppe = tarigruppe;
|
||||
GehaltBerechnen();
|
||||
}
|
||||
public void GehaltBerechnen()
|
||||
{
|
||||
double grundgehalt = 0;
|
||||
switch (this.tarigruppe)
|
||||
{
|
||||
case Tarigruppe.A:
|
||||
grundgehalt = 2560;
|
||||
break;
|
||||
case Tarigruppe.B:
|
||||
grundgehalt = 3000;
|
||||
break;
|
||||
case Tarigruppe.C:
|
||||
grundgehalt = 3200;
|
||||
break;
|
||||
case Tarigruppe.D:
|
||||
grundgehalt = 5400;
|
||||
break;
|
||||
}
|
||||
gehalt = grundgehalt * (1 + (alter - 25) / 100.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user