48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|