Mistři v programování na #hovnokod

Visual Basic #582

Public Function Cost(ByVal Vip1 As Boolean, ByVal Dat1 As Date, ByVal Kol1 As Integer, ByVal Cost1 As Decimal) As Decimal

        If Vip1 Then
            Return Bas(Cost1, Kol1) * 0.9 + IIf(Cost1 * Kol1 < 50, 50, Bas(Cost1, Kol1) * 0.11)
        Else
            Dim Sk1 As Decimal
            If Leto(Dat1) Then
                Sk1 = IIf(Bas(Cost1, Kol1) < 1000, 2, 3)
            Else
                Sk1 = IIf(Bas(Cost1, Kol1) < 1100, 3, 0)
            End If
            Dim Sk2 As Decimal = IIf(Kol1 > 500, 5, 0)
            Dim Sk3 As Decimal
            If Leto(Dat1) Then
                Sk3 = IIf(Bas(Cost1, Kol1) < 100, 100, Bas(Cost1, Kol1) * 0.1)
            Else
                Sk3 = IIf(Bas(Cost1, Kol1) < 110, 110, Bas(Cost1, Kol1) * 0.11)
            End If
            Return (Bas(Cost1, Kol1) - Bas(Cost1, Kol1) * Sk1 * 100 - Bas(Cost1, Kol1) * Sk2 * 100 + Sk3)
        End If
    End Function

HovnoKod,