Option Explicit
' Aufgabe 1.1
Function netto_einfach(ByVal brutto As Double) As Double
netto_einfach = brutto / 1.19
End Function
Function netto(ByVal brutto As Double, ByVal satz As Integer) As 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 Double, ByVal prozentsatz As Double) As Double
prozentsatz_addieren = wert * (1 + prozentsatz / 100)
End Function
' Aufgabe 1.3
Function netto_brutto(ByVal wert As Double, ByVal richtung As Integer) As 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 Double) As 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