Option Explicit

' Aufgabe 1.1
Function netto_einfach(ByVal brutto As DoubleAs Double
    netto_einfach = brutto / 1.19
End Function

Function netto(ByVal brutto As DoubleByVal satz As IntegerAs Double
    If satz = 1 Then
        netto = brutto / 1.19
    ElseIf satz = 2 Then
        netto = brutto / 1.07
    Else
        netto = brutto
    End If
End Function

' Aufgabe 1.2

Function prozentsatz_addieren(ByVal wert As DoubleByVal prozentsatz As DoubleAs Double
    prozentsatz_addieren = wert * (1 + prozentsatz / 100)
End Function

' Aufgabe 1.3

Function netto_brutto(ByVal wert As DoubleByVal richtung As IntegerAs Double
    If richtung = 1 Then
        netto_brutto = wert * 1.19
    Else
        netto_brutto = wert / 1.19
    End If
End Function

' Aufgabe 1.4

Function meinName()
        meinName = "Ihr Name"
End Function

' Aufgabe 1.5

Function subtraktion(minuend As Double, subtrahend As DoubleAs Double
        Dim differenz As Double
        differenz = minuend - subtrahend
        subtraktion = differenz
End Function

' Aufgabe 1.6

Function addiereNegativBisZuFormel(bisZu As Integer)
         Dim summe As Integer
     Dim i As Integer
     summe = (bisZu * (bisZu + 1)) / 2
     addiereNegativBisZuFormel = -1 * summe
 End Function